An ARIA role is a value of the role attribute, defined by the WAI-ARIA specification, that tells assistive technologies what kind of element a piece of markup represents, for example a button, a dialog, a tab or a navigation landmark. In web accessibility, roles fill the gap when native HTML semantics are missing or insufficient, so that screen readers and voice control software can announce and operate custom interface components correctly.
A role changes only the semantics exposed in the accessibility tree. It does not add keyboard behavior, focusability or visual styling, which is why the first rule of ARIA advises using a native HTML element whenever one exists before reaching for a role.
How an ARIA role reaches assistive technology
Browsers build an accessibility tree in parallel with the DOM, and an ARIA role overrides the implicit role that the browser would otherwise compute for an element. A div normally has the generic role, but role="button" makes the browser report it to the platform accessibility API as a button.
Operating systems expose that information through platform accessibility APIs such as UI Automation and MSAA on Windows, NSAccessibility on macOS and AT-SPI on Linux. Screen readers like NVDA, JAWS and VoiceOver read the role from these APIs and announce it together with the accessible name and state, for example “Save, button” or “Settings, expanded, button”.
The table below separates what a role does from what it leaves to the developer, which is the most frequently misunderstood point about ARIA.
| Aspect | Changed by the role | Developer responsibility |
|---|---|---|
| Announced element type | Yes | Choose the correct role |
| Keyboard focus | No | Add tabindex="0" when needed |
| Keyboard interaction | No | Handle Enter, Space and arrow keys |
| States and properties | No | Maintain aria-expanded, aria-selected and similar |
| Visual appearance | No | Style with CSS, including focus indicators |
| Accessible name | Partly, for some roles | Provide visible text or aria-label |
Categories of ARIA roles
WAI-ARIA groups roles into categories by purpose, and each category implies different authoring obligations. Abstract roles such as widget or landmark exist only to structure the taxonomy and must never be used in markup.
| Category | Purpose | Example roles |
|---|---|---|
| Widget roles | Interactive controls | button, checkbox, slider, tab |
| Composite widget roles | Containers that manage child focus | menu, tablist, grid, listbox |
| Document structure roles | Describe content organization | heading, list, article, img |
| Landmark roles | Mark major page regions | banner, navigation, main, contentinfo |
| Live region roles | Announce dynamic updates | alert, status, log, timer |
| Window roles | Mark separate windows | dialog, alertdialog |
Some roles carry required owned elements or required context. A tablist must contain elements with role tab, and a menuitem must sit inside a menu or menubar. Breaking these parent and child relationships produces an invalid accessibility tree that screen readers may announce inconsistently.
Implicit roles of native HTML elements
Most HTML elements already map to an ARIA role, a mapping defined in the HTML Accessibility API Mappings specification. Adding the same role explicitly is redundant, and replacing a native element with a styled div plus a role usually costs more code and introduces bugs.
| Native element | Implicit role | Built-in behavior lost with a div |
|---|---|---|
| `button` | button | Focus, Enter and Space activation |
| `a` with `href` | link | Focus, Enter activation, context menu |
| `nav` | navigation | Landmark navigation shortcut |
| `main` | main | Skip-to-content landmark |
| `input type=”checkbox”` | checkbox | Checked state, Space toggling, form submission |
| `dialog` | dialog | Modal focus containment with showModal() |
This mapping explains why an ARIA role is best treated as a repair or extension tool. It is the right choice for patterns that HTML lacks natively, such as tabs, tree views, comboboxes and data grids, and for retrofitting legacy markup that cannot be rewritten quickly.
Choosing and applying the correct role
Choosing a role starts with what the component does, not with how it looks. A control that triggers an action is a button; one that navigates to a new URL is a link, even if both are styled identically. The ARIA Authoring Practices Guide documents the expected keyboard model for each widget pattern.
The following decision table covers frequent interface patterns and the recommended semantics.
| Pattern | Recommended semantics | Key requirement |
|---|---|---|
| Clickable icon that opens a panel | Native button with aria-expanded | Accessible name for the icon |
| Tabbed content panels | tablist, tab, tabpanel | Arrow keys and roving tabindex |
| Modal confirmation window | dialog or alertdialog | Focus trap and focus return |
| Form error summary | alert for urgent messages | Insert content after page load |
| Site-wide header region | Native header as banner | Only one banner per page |
| Decorative image | Empty alt or role="presentation" | Hidden from screen readers |
After applying a role, teams should verify the result in the accessibility tree using browser developer tools and test with at least one real screen reader. Automated tools such as WAVE or Pa11y catch invalid role values and missing required children, but they cannot confirm that keyboard interaction matches the announced role.
Common mistakes with ARIA roles
Incorrect roles are often worse than no ARIA at all, because they promise behavior that the component does not deliver. Large accessibility surveys of public websites consistently find that pages using ARIA tend to have more detected errors, largely due to the misuse patterns below.
- Role without keyboard support:
role="button"on adivthat responds only to mouse clicks leaves keyboard users stranded. - Overriding native semantics:
role="heading"on abuttondestroys the button role that users relied on. - Using `role=”menu”` for site navigation: application menus expect arrow-key navigation, whereas ordinary link lists do not.
- Hiding focusable content:
role="presentation"oraria-hiddenon an element that still receives focus creates silent focus stops. - Misspelled or invented roles: browsers ignore unknown values, so the element silently falls back to its implicit role.
A non-technical view
People who are blind often use a screen reader, software that reads a web page aloud. To be useful, it must say not only the words on the page but also what each thing is: a button, a link, a menu or a pop-up window.
An ARIA role is a label hidden in the code that tells the screen reader what an element is when the page itself does not make it clear. It works like a name tag at a conference. The tag tells you someone is the speaker, but it does not make that person able to speak. The key takeaway is that the label must match how the element really behaves, or it misleads the very people it is meant to help.
A concrete example
A municipal website offers an online permit form with a custom date picker and a set of tabs for applicant, property and payment details. During an accessibility audit, a tester using NVDA hears the tabs announced only as “clickable” text and cannot reach the date picker with the keyboard at all.
The development team rebuilds the tabs with role="tablist", role="tab" and role="tabpanel", adds aria-selected states and implements arrow-key navigation with roving tabindex. For the date picker, they decide that a native input type="date" meets the requirements, which removes about 200 lines of custom JavaScript and the need for any role.
The outcome is a form that screen reader users can now complete independently. Retesting with NVDA and VoiceOver confirms that each tab is announced as “tab, 2 of 3, selected”, and the number of support calls from residents asking for help with the form drops noticeably in the following quarter.