roving tabindex
A technique where only the active item in a group has tabindex="0" and the rest have tabindex="-1", so the group is one tab stop and arrow keys move between items.
In more detail
When the user presses an arrow key, the code moves tabindex 0 to the next item and calls focus() on it. Tab then leaves the group entirely. It is used for menus, toolbars, tab lists and radio groups, and should skip disabled items.
Related terms
- tabindex — The HTML attribute that controls whether an element can be focused and whether it is in the tab order.
- composite widget — An interactive component made of several focusable items, such as a toolbar, tab list, menu or radio group, that acts as one tab stop.
- aria-activedescendant — An ARIA property that points, by id, at the option that is currently active inside a widget, while real keyboard focus stays on the widget itself.
- 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.
- 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.
Taught in
- Navigation & Disclosure: Dropdown Menus, Tabs & Accordions — Design Systems & Component Engineering
- Keyboard Navigation Protocols: Roving Tabindex & Virtual Focus — Design Systems & Component Engineering
- Accessible Headless Primitives: ARIA, Focus, And Keyboard — React 19 & Modern Component Architecture