Form
Select typeahead input
Published on
Description
The select typeahead input lets people filter a long list of options by typing, while keeping the behaviour of a native <select>. All options are pre-rendered in the page and no requests are made — typing simply narrows the visible list.
It is built as a progressive enhancement. Without JavaScript the control renders as a plain <select> and works normally; the browser downloads the enhancement only when the field scrolls into view. Once enhanced, the visible input shows the chosen option's label while the underlying <select> keeps its value, so form submissions are unchanged.
Prefer a plain select — or better, radios — when there are only a handful of options. Reach for the typeahead only for long lists (countries, currencies, timezones) where filtering meaningfully reduces effort.
Example
Accessibility
- The enhanced control exposes a
comboboxwith an attachedlistbox, following the WAI-ARIA authoring practices for autocomplete. - Keyboard: type to filter,
ArrowDown/ArrowUpto move through results,Enterto confirm, andEscapeto dismiss the menu. - A polite live region announces the number of available results and the highlighted option to screen reader users.
- The native
<label for>stays associated with the enhanced input, so the field keeps its accessible name. - Because the base control is a real
<select>, keyboard and assistive technology support is guaranteed even if the enhancement fails to load.
Internationalization
The "no results" message is set with the textNoResults prop, which is forwarded to the web component as data-i18n-no-results. Provide a translated string per locale.
References
- Combobox Pattern(opens in new tab) — WAI-ARIA Authoring Practices
- Under-Engineered Select Menus(opens in new tab) — Adrian Roselli
Related
- Select — for short option lists
- Radio buttons — for a few visible options
- Search — for querying beyond a fixed list
Variables
None for input