Skip to content

Dropdown

A dropdown displays a list of selectable options in a floating panel.

source code
source code

The dropdown follows the WAI-ARIA Listbox pattern.

ElementAttributes
Trigger buttonaria-haspopup="listbox", aria-expanded, aria-labelledby (pointing to a visible label)
List containerrole="listbox". Add aria-multiselectable="true" for checkbox-style dropdowns.
Each optionrole="option". Set aria-selected="true" on the active option.

Use aria-activedescendant on the listbox to communicate the currently focused option without moving DOM focus.

KeyAction
Enter / SpaceOpen dropdown or select the focused option
/ Move focus between options
Home / EndMove focus to first / last option
EscapeClose dropdown, return focus to trigger