ARIA role
The role attribute that tells assistive technology what kind of thing an element is, such as button, dialog, tab or switch.
In more detail
Native elements have implicit roles, so <button> is already role button. Custom widgets set role explicitly and must then provide the keyboard behaviour that role promises. Roles, together with states and properties, are the three kinds of ARIA information.
Examples
In the browser: Roles set expectations: a user who hears button expects Enter and Space to work. Only add a role when no native element does the job.<div role="tablist"><button role="tab" aria-selected={true}>A</button></div>Related terms
- ARIA — The W3C standard of HTML attributes, such as role and aria-expanded, that tell assistive technology what a custom widget is and what state it is in.
- ARIA states and properties — The aria-* attributes that describe an element's current condition, such as aria-expanded="true", or its relationships, such as aria-controls.
- semantic HTML — Using HTML elements for their meaning, such as <button> for actions and <nav> for navigation, rather than generic <div>s.
- implicit ARIA role — The ARIA role an HTML element has automatically, such as button for <button> or navigation for <nav>, without any role attribute.
- ARIA states and properties — The aria-* attributes that describe an element's current condition or relationships, such as aria-expanded="true" or aria-controls="panel-1".
- keyboard navigation — Using a page entirely with the keyboard: Tab to move between controls, Enter and Space to activate, arrow keys inside widgets, Escape to close.
- widget — A self-contained interactive piece of an interface, such as a tab panel, date picker or accordion.
Taught in
- Headless Architecture: State vs Presentation Separation — Design Systems & Component Engineering
- Actionable Form Primitives: Buttons, Switches & Inputs — Design Systems & Component Engineering
- Modal Dialogs & Alert Dialogs: Accessible Overlay Patterns — Design Systems & Component Engineering
- WAI-ARIA Semantics: Roles, States & Accessible Name Computation — Design Systems & Component Engineering
- Accessibility Tree, ARIA Roles, States And Live Regions — Frontend Architecture & Web Platform
- React Fiber Architecture: Work Units, Priority And Commits — React 19 & Modern Component Architecture
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture
- Accessible Headless Primitives: ARIA, Focus, And Keyboard — React 19 & Modern Component Architecture