Favorites

ARIA tab Role

tab
ARIA Widget RoleThis ARIA role is supported by all modern browsers.
Updated 28th November 2026

The tab role marks one tab in a tabbed interface. Tabs sit inside a tablist, and each one controls a tabpanel that is shown when the tab is selected.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The tab role marks one of the tabs in a tabbed interface. A set of tabs is grouped in an element with the tablist role, and each tab controls an element with the tabpanel role that holds its content. Only the panel of the selected tab is shown.

The selected tab has aria-selected="true" and the others aria-selected="false". Each tab points to its panel with aria-controls, and each panel is labelled by its tab with aria-labelledby. Screen readers announce the role and position, for example "Details, tab, selected, 2 of 3".

There is no native HTML tab element, so the keyboard behavior has to be added with JavaScript. Only the selected tab is in the Tab order (tabindex="0", the others tabindex="-1"); the Left and Right arrow keys move between tabs, and Home and End go to the first and last tab. Tabs must be direct children of the tablist, or owned by it with aria-owns.

Properties

Category
Widget
HTML equivalent
None
Accessible name from
contents, author
Required parent role
tablist
Required child roles
None

ARIA Attributes

Syntax

<div role="tablist">
  <button role="tab" aria-selected="true" aria-controls="panel-id">...</button>
</div>

Example

<div role="tablist" aria-label="Product">
<button role="tab" id="t1" aria-selected="true" aria-controls="p1">Overview</button>
<button role="tab" id="t2" aria-selected="false" aria-controls="p2" tabindex="-1">Details</button>
</div>
<div role="tabpanel" id="p1" aria-labelledby="t1"><p>Overview content.</p></div>
<div role="tabpanel" id="p2" aria-labelledby="t2" hidden><p>Details content.</p></div>
<script>
document.querySelectorAll('[role=tab]').forEach(function (tab) {
tab.addEventListener('click', function () {
document.querySelectorAll('[role=tab]').forEach(function (t) {
var on = t === tab;
t.setAttribute('aria-selected', on);
t.tabIndex = on ? 0 : -1;
document.getElementById(t.getAttribute('aria-controls')).hidden = !on;
});
});
});
</script>

Browser Support

The following information will show you the current browser support for the tab ARIA role. Hover over a browser icon to see the version that first introduced support for this ARIA role.

This ARIA role is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee