consolelog.tools logo

ARIA Roles Reference

Complete reference guide to ARIA roles with examples and best practices

Found 31 roles

role="banner"

landmark

Site header/banner containing site-wide content

HTML Equivalent: <header> (when direct child of body)

Common Mistakes:

  • Using banner for subsection headers
  • Multiple banners without aria-label
View example
<header role="banner">
  <h1>Site Title</h1>
  <nav>...</nav>
</header>

WCAG 2.1 - 1.3.1 Info and Relationships

role="navigation"

landmark

Navigation section with links to navigate the site

HTML Equivalent: <nav>

Common Attributes:

aria-labelaria-labelledby

Common Mistakes:

  • Not labeling multiple nav regions
  • Using nav for non-navigation content
View example
<nav role="navigation" aria-label="Main Navigation">
  <ul>
    <li><a href="/">Home</a></li>
  </ul>
</nav>

WCAG 2.1 - 2.4.1 Bypass Blocks

role="main"

landmark

Main content of the document

HTML Equivalent: <main>

Common Mistakes:

  • Multiple main landmarks
  • Not making main the skip link target
View example
<main role="main" id="main-content">
  <h1>Page Title</h1>
  <article>...</article>
</main>

WCAG 2.1 - 2.4.1 Bypass Blocks

role="complementary"

landmark

Supporting content related to main content

HTML Equivalent: <aside>

Common Attributes:

aria-labelaria-labelledby
View example
<aside role="complementary" aria-label="Related Articles">
  <h2>Related</h2>
  <ul>...</ul>
</aside>

WCAG 2.1 - 1.3.1 Info and Relationships

role="contentinfo"

landmark

Footer with metadata about the document

HTML Equivalent: <footer> (when direct child of body)

View example
<footer role="contentinfo">
  <p>&copy; 2024 Company</p>
</footer>

WCAG 2.1 - 1.3.1 Info and Relationships

role="search"

landmark

Search functionality

Common Attributes:

aria-labelaria-labelledby
View example
<div role="search" aria-label="Site Search">
  <input type="search" />
  <button>Search</button>
</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="region"

landmark

Important content area that users may want to navigate to

Required Attributes:

aria-label or aria-labelledby

Common Mistakes:

  • Using region without a label
  • Overusing region for minor sections
View example
<section role="region" aria-labelledby="section-title">
  <h2 id="section-title">Important Section</h2>
</section>

WCAG 2.1 - 1.3.1 Info and Relationships

role="form"

landmark

Form landmark when form is significant

HTML Equivalent: <form> (when has accessible name)

Common Attributes:

aria-labelaria-labelledby
View example
<form role="form" aria-label="Contact Form">
  <label>...</label>
  <input />
</form>

WCAG 2.1 - 1.3.1 Info and Relationships

role="button"

widget

Clickable element that triggers an action

HTML Equivalent: <button>

Required Attributes:

accessible name

Keyboard:

  • Enter: Activate
  • Space: Activate

Common Mistakes:

  • Forgetting tabindex="0"
  • Not handling keyboard events
  • Missing accessible name
View example
<div role="button" tabindex="0" onclick="handleClick()">
  Click Me
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="link"

widget

Hyperlink to another page or location

HTML Equivalent: <a href>

Keyboard:

  • Enter: Follow link

Common Mistakes:

  • Using for buttons/actions
  • Not implementing navigation behavior
View example
<span role="link" tabindex="0" onclick="navigate()">
  Go to page
</span>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="tab"

widget

Tab in a tablist

Required Attributes:

aria-selectedaria-controls

Keyboard:

  • Arrow keys: Navigate tabs
  • Space/Enter: Activate
View example
<button role="tab" aria-selected="true" aria-controls="panel-1">
  Tab 1
</button>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="tablist"

widget

Container for tabs

Common Attributes:

aria-labelaria-labelledbyaria-orientation
View example
<div role="tablist" aria-label="Settings Tabs">
  <button role="tab">...</button>
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="tabpanel"

widget

Content panel for a tab

Required Attributes:

aria-labelledby
View example
<div role="tabpanel" aria-labelledby="tab-1" tabindex="0">
  Tab content...
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="checkbox"

widget

Checkable input with three states

HTML Equivalent: <input type="checkbox">

Required Attributes:

aria-checked

Keyboard:

  • Space: Toggle checked
View example
<div role="checkbox" aria-checked="false" tabindex="0">
  Accept terms
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="radio"

widget

Radio button in a radiogroup

HTML Equivalent: <input type="radio">

Required Attributes:

aria-checked

Keyboard:

  • Arrow keys: Select option
  • Space: Select
View example
<div role="radio" aria-checked="false" tabindex="0">
  Option 1
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="slider"

widget

Range input with min/max values

HTML Equivalent: <input type="range">

Required Attributes:

aria-valuenowaria-valueminaria-valuemax

Keyboard:

  • Arrow keys: Adjust value
  • Home/End: Min/Max
View example
<div role="slider" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" tabindex="0">
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="combobox"

widget

Input with popup list of options

Required Attributes:

aria-expandedaria-controls

Keyboard:

  • Arrow Down: Open/navigate list
  • Esc: Close
  • Enter: Select
View example
<input role="combobox" aria-expanded="false" aria-controls="listbox-1" aria-autocomplete="list" />

WCAG 2.1 - 4.1.2 Name, Role, Value

role="menu"

widget

Menu with selectable items

Keyboard:

  • Arrow keys: Navigate
  • Enter: Select
  • Esc: Close

Common Mistakes:

  • Using menu for navigation (use nav instead)
  • Incorrect keyboard behavior
View example
<ul role="menu">
  <li role="menuitem">Option 1</li>
  <li role="menuitem">Option 2</li>
</ul>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="article"

document

Self-contained composition

HTML Equivalent: <article>

View example
<div role="article">
  <h2>Article Title</h2>
  <p>Content...</p>
</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="heading"

document

Heading for a section

HTML Equivalent: <h1> - <h6>

Required Attributes:

aria-level

Common Mistakes:

  • Using heading without aria-level
  • Prefer semantic <h1>-<h6> elements
View example
<div role="heading" aria-level="2">Section Heading</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="list"

document

List container

HTML Equivalent: <ul>, <ol>

View example
<div role="list">
  <div role="listitem">Item 1</div>
  <div role="listitem">Item 2</div>
</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="listitem"

document

Item in a list

HTML Equivalent: <li>

View example
<div role="listitem">List item content</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="img"

document

Image or image container

HTML Equivalent: <img>

Required Attributes:

accessible name
View example
<div role="img" aria-label="Company logo">
  <svg>...</svg>
</div>

WCAG 2.1 - 1.1.1 Non-text Content

role="figure"

document

Figure with optional caption

HTML Equivalent: <figure>

View example
<div role="figure" aria-labelledby="caption">
  <img src="chart.png" alt="Sales data" />
  <div id="caption">Q4 Sales</div>
</div>

WCAG 2.1 - 1.3.1 Info and Relationships

role="alert"

live-region

Important, time-sensitive message

Common Attributes:

aria-live="assertive" (implicit)

Common Mistakes:

  • Overusing alerts
  • Not making alerts dismissible
View example
<div role="alert">
  Error: Form submission failed
</div>

WCAG 2.1 - 4.1.3 Status Messages

role="status"

live-region

Advisory information for user

Common Attributes:

aria-live="polite" (implicit)aria-atomic
View example
<div role="status" aria-live="polite">
  Form saved successfully
</div>

WCAG 2.1 - 4.1.3 Status Messages

role="log"

live-region

Live scrolling log of messages

Common Attributes:

aria-live="polite" (implicit)
View example
<div role="log" aria-live="polite">
  <div>10:30 AM: User logged in</div>
  <div>10:31 AM: File uploaded</div>
</div>

WCAG 2.1 - 4.1.3 Status Messages

role="timer"

live-region

Timer or clock

View example
<div role="timer" aria-live="off">
  <span aria-atomic="true">5:00</span>
</div>

WCAG 2.1 - 4.1.3 Status Messages

role="marquee"

live-region

Non-essential scrolling information

Common Attributes:

aria-live="off" (implicit)

Common Mistakes:

  • Using for important information
  • Auto-scrolling content
View example
<div role="marquee" aria-live="off">
  Latest news headlines...
</div>

WCAG 2.1 - 4.1.3 Status Messages

role="dialog"

window

Dialog window that interrupts main flow

Required Attributes:

aria-label or aria-labelledbyaria-modal

Keyboard:

  • Tab: Cycle focus within dialog
  • Esc: Close dialog

Common Mistakes:

  • Not trapping focus
  • Not returning focus on close
  • Missing Esc key handler
View example
<div role="dialog" aria-labelledby="dialog-title" aria-modal="true">
  <h2 id="dialog-title">Confirm Action</h2>
  <p>Are you sure?</p>
  <button>Confirm</button>
  <button>Cancel</button>
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

role="alertdialog"

window

Modal dialog with important message

Required Attributes:

aria-label or aria-labelledbyaria-describedby

Keyboard:

  • Tab: Cycle focus
  • Esc: Close
View example
<div role="alertdialog" aria-labelledby="title" aria-describedby="desc" aria-modal="true">
  <h2 id="title">Delete Item?</h2>
  <p id="desc">This cannot be undone</p>
  <button>Delete</button>
  <button>Cancel</button>
</div>

WCAG 2.1 - 4.1.2 Name, Role, Value

ARIA Best Practices

First Rule of ARIA

  • If you can use a native HTML element or attribute, use it instead of ARIA
  • Native elements have built-in keyboard support, roles, and states
  • Example: Use <button> instead of <div role="button">

Don't Change Native Semantics

  • Don't override native element semantics with ARIA
  • Bad: <h2 role="tab">
  • Good: <div role="tab">

All Interactive ARIA Controls Must Be Keyboard Accessible

  • If you use role="button", it must be keyboard operable
  • Add tabindex="0" for keyboard focus
  • Implement keyboard event handlers (Enter, Space, Arrow keys, etc.)

Don't Use role="presentation" or aria-hidden="true" on Focusable Elements

  • Focusable elements must have a role
  • Hiding focusable content creates keyboard traps
  • Bad: <button aria-hidden="true">

All Interactive Elements Must Have an Accessible Name

  • Use aria-label, aria-labelledby, or visible text
  • Test: Screen reader must announce a meaningful name
  • Bad: <button><svg>...</svg></button>
  • Good: <button aria-label="Close"><svg>...</svg></button>

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Frequently Asked Questions - ARIA Roles Reference