Components
← All components

Listbox

stimeo--listbox

A select that opens a list and takes one choice, with focus staying on the button.

  • Core
  • Listbox

Implements the WAI-ARIA Listbox pattern in its open-and-choose form. Pressing the button opens the list. Focus stays on the button while screen readers are told which choice is current. The arrow keys wrap around, Home and End jump to the ends, and typing a character jumps to the choice starting with it. Opening starts from the chosen option, or the first one if there is none. Choosing updates both the button's label and the value your form submits. Esc, a click outside, and Tab all close it, and choosing or pressing Esc returns focus to the button. Placement here is this demo's CSS.

running
Favorite fruit

Keyboard

KeyAction
Enter / Space / ↓ / ↑ Open the listbox while it is closed.
↓ / ↑ Move the active option while open (wrapping).
Home / End Move to the first / last option.
Printable characters Typeahead to the next option starting with the typed text; repeating a character cycles through the options sharing that letter.
Enter / Space Select the active option and close.
Esc Close without selecting and return focus to the trigger.