Skip to content
IndexRequest a UIAboutContact

Searchable Select Combobox

A select with a long list you can filter by typing, with arrow keys, highlighted matches and a no-results message.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a country selector: a text field with the letters ger typed and a chevron, below it an open list with three matches Germany with the first letters highlighted in bold, Nigeria and Algeria with the matching letters bold inside, the first row highlighted, a small count 3 results, and below the field another state showing the text No countries found, light theme, flat modern style. Negative: heavy shadows, clutter, text errors, device frames. Reduced motion: static design.

About this pattern

Definition

A plain select with dozens of options is slow to use. A combobox lets people type to narrow the list, then pick with the mouse or keyboard. The matching part of each option is highlighted, an empty result says so, and the chosen value stays visible in the field.

Purpose & UX principles

  • Use an input with role combobox, aria-expanded, aria-controls and aria-activedescendant; the list has role listbox.
  • Filter as you type, case-insensitive, matching from the start of words first.
  • Arrow keys move through matches, Enter selects, Escape closes and restores the last value.
  • Show a clear no-results message and keep the field usable.

Interaction states

  • Type part of a country name, use the arrow keys and Enter.

Motion specification

  • The list opens in 120ms.
  • Reduced motion: no fade.

Responsive behaviour

  • Keep focus in the input while the list is open.
  • Announce the number of results for screen readers.

Code

HTML
<div class="bx"><label class="fl" for="cb">Country</label><div class="wr"><input id="cb" type="text" role="combobox" aria-expanded="false" aria-controls="lb" aria-autocomplete="list" autocomplete="off" placeholder="Start typing…"><ul id="lb" class="lb" role="listbox" aria-label="Countries" hidden></ul></div><p class="out" id="out" role="status"></p></div>

Related patterns

Dropdown Menu

↗
Dropdown MenuOverlays & Dialogs

Mention Autocomplete Menu

↗
Mention Autocomplete MenuInputs & Forms

Search Input

↗
Search InputInputs & Forms