WAI-ARIA (Web Accessibility Initiative - Accessible Rich Internet Applications) is a technical specification for HTML attributes.
It’s used to apply semantics to elements that cannot be defined with HTML alone, which helps assistive technologies (AT) work predictably. In other words, when native HTML can’t explain what an element does, WAI-ARIA — or ARIA, for short — fills in.
The aria-label attribute is especially important for AT users. An ARIA label provides the text label for a button, navigation landmark, or another interactive object. In this article, we’ll explain how ARIA labels can be used to improve web accessibility and provide some tips for using the aria-label attribute appropriately.
First, a quick word of caution: ARIA is a useful tool for improving accessibility, but misusing ARIA can actually make your page less accessible. If you’re using ARIA labels, we strongly recommend working with an accessibility partner and testing your content with screen readers and other AT.
In digital accessibility terminology, an accessible name is information that can be used to identify an element. It’s exposed in the website’s accessibility tree, and it’s important for screen readers and other AT: Without accessible names, users may have trouble navigating or operating your website.
In most cases, your content will have an accessible name that is created by the text content of its wrapping element. For example, let’s say you include a picture of a red apple with descriptive alternative text:
<img src=”/images/redapple.jpg" alt=”a red apple" />
In this case, the alt text (“a red apple") would function as the accessible name for the image. ARIA labels can also provide accessible names for interactive elements and give them meaning.
Related: How Accessible Names Can Help (Or Frustrate) Your Users
You do not need ARIA labels for every single element on your web page. In fact, the first rule of ARIA is to avoid using it — native HTML is a better choice for defining semantics and improving accessibility.
However, you may need another way to label an interactive element for several reasons:
Related: 4 Mistakes to Avoid When using ARIA Roles
WCAG doesn’t require that websites use ARIA, but the guidelines do require accessible names for elements in success criterion 4.1.2, “Name, Role, Value:”
For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
The aria-label and aria-labelledby attributes can be used to fulfill this requirement.
But rather than worrying too much about WCAG conformance, we recommend thinking about the user. Accurate labels help people browse your website with speech recognition software. Screen readers will be able to describe the purpose and function of buttons, form fields, and other important elements.
You want your content to work for as many people as possible; ARIA labels may help you achieve that goal.
Related: 5 Tips for Using ARIA to Improve Web Accessibility
Once again, if you’re using ARIA, we recommend working with an accessibility partner. Certain misused ARIA roles can break your website for AT users, and while a bad ARIA label is unlikely to have that sort of impact, you need to test your website carefully to ensure the best possible experience for your users.
A few quick tips:
For additional guidance, send us a message to connect with an accessibility expert.