Purpose
Provide a flexible replacement for native select elements with richer styling and behavior.
Loading ...
listboxA scrollable list of options that lets people choose one or multiple values. Listboxes often power custom selects or filter pickers.
Single-select listbox with roving focus, arrow keys, Home/End, and selection announcement.
Choose a section
Selected: Dashboard
Provide a flexible replacement for native select elements with richer styling and behavior.
Usually keeps DOM focus inside the listbox and roves active option with tabindex.
Announces position (1 of N) and selected state while supporting letter navigation.
Allow people to pick multiple facets (tags, categories, permissions) quickly.
Style default pickers, add icons, group options, or show meta data.
Act as the suggestion surface inside a combobox or menu button.
role="listbox" element needs an accessible name via aria-label or aria-labelledby.
Direct children must use role="option" (or be wrapped in group elements that contain options).
Use aria-selected to reflect the actual selection. Update it immediately when state changes.
| Action | Keys | Result |
|---|---|---|
| Move focus | ArrowUp / ArrowDown | Moves between options while keeping focus inside the listbox. |
| Jump to edges | Home / End | Moves to the first or last option. |
| Select option | Space / Enter | Toggles aria-selected on the focused option. |
| Range selection | Shift + Arrow / Shift + Space | Extends the selection when aria-multiselectable is true. |
| Typeahead | Printable characters | Focuses the next option whose text matches the typed characters. |
aria-label / aria-labelledbyRequiredProvides an accessible name for the listbox. Required when no visible label is present.
aria-activedescendantOptionalAlternative to roving tabindex. Reference the id of the focused option.
aria-multiselectableOptionalSet to true to indicate multiple selections are allowed.
aria-requiredOptionalCommunicates that the user must pick an option before submitting.
aria-describedbyOptionalPoint to helper text explaining keyboard shortcuts or selection behavior.
If you wrap options in custom markup, ensure the element with role="option" receives aria-selected and tabindex.
Keep the focused option visible (scroll into view) so keyboard users always know their position.
When used as part of a combobox, hide the listbox visually but keep it mounted the entire time.
Use aria-live or status text to confirm selections in multi-select scenarios when the list is long.
Mirror selection state visually with strong contrast for selected options.
Roving tabindex ensures only the focused option is in the tab order.
<div role="listbox" aria-label="Project status" id="status-listbox">
<div role="option" id="status-1" tabindex="0" aria-selected="true">Not Started</div>
<div role="option" id="status-2" tabindex="-1" aria-selected="false">In Progress</div>
<div role="option" id="status-3" tabindex="-1" aria-selected="false">Blocked</div>
<div role="option" id="status-4" tabindex="-1" aria-selected="false">Complete</div>
</div>aria-multiselectable announces that multiple values can be toggled.
<p id="filter-hint">Use Space to toggle and Shift+Arrow for range selection.</p>
<div
role="listbox"
aria-multiselectable="true"
aria-labelledby="filters-label"
aria-describedby="filter-hint"
>
<span id="filters-label" class="sr-only">Filter by topics</span>
<div role="option" aria-selected="true" tabindex="0">Performance</div>
<div role="option" aria-selected="false" tabindex="-1">Security</div>
<div role="option" aria-selected="false" tabindex="-1">Accessibility</div>
<div role="option" aria-selected="true" tabindex="-1">DevOps</div>
</div>Explain whether users can choose one or many items and which modifiers to use.
Keep id attributes stable so aria-activedescendant references remain valid when filtering.
Clicking an option should also update tabindex and aria-selected.
Buttons inside the list steal focus and break arrow navigation.
Keep options focusable elements and nest button-like UI inside using aria-hidden.
Users cannot determine which items were chosen, especially in multi-select lists.
Toggle aria-selected immediately whenever selection state changes.
The selectable child role inside a listbox.
Learn moreEditable widget that commonly controls a listbox popup.
Learn moreCommand-based list that shares similar navigation patterns.
Learn more