Design System
Forms

Combobox

A searchable select with autocomplete. It is a controlled component, so hold the chosen value in state.

Purpose

Reach for a combobox once a Select list is long enough that scanning it is slower than typing. For several choices at once use Multi-select.

Example

Controlled usage
const [clinic, setClinic] = React.useState("");

<Combobox
  options={CLINIC_OPTIONS}
  value={clinic}
  onValueChange={setClinic}
  placeholder="Select a panel clinic…"
  searchPlaceholder="Search clinics…"
  emptyText="No matching clinic."
/>

States

  • Empty search — when the filter matches nothing, the list shows emptyText (default "No results found."). Make it say what was searched over: "No matching clinic." — try typing nonsense in the example above.
  • Selected — the trigger shows the option's label; the open list marks it with a --primary check. Selecting it again clears the value (onValueChange fires with "").
  • Disabled — there is none: ComboboxProps exposes no disabled, so omit the control or render the value as text when it cannot be changed.

Structure

PropertyValue
Triggeroutline Button, 40px (h-10), full width, space-between
Trigger icon18px unfold_more glyph, --muted-foreground
Placeholder--muted-foreground
Listbox--popover surface, --radius-lg, --shadow-8, width matches the trigger
Selected mark16px check glyph in --primary
Searchtext input pinned above the list

Best practices

Do

  • Use it for long, familiar lists — panel clinics, medications — where typing beats scrolling.
  • Give it an accessible name: the label prop, or a visible <Label htmlFor> paired with id.
  • Write emptyText that names the collection ("No matching clinic."), not a bare "No results".
  • Keep option labels unique — they are what the filter searches.

Don't

  • Use it for a handful of options — that is a Select or Radio group.
  • Use it for several choices at once — that is Multi-select.
  • Rely on the trigger text as the name — screen readers read it as the value, not the label.

Accessibility & keyboard

  • The trigger needs a name. It carries role="combobox", whose accessible name does not come from its own text — that text is read as the current value. Without a name, a screen reader announces the selected option with no indication of what it selects. Pass the label prop (it defaults to the placeholder text), or pair a visible <Label htmlFor> with the id prop and omit label.
  • The trigger exposes aria-expanded; when the list opens, focus moves into the search input.
  • Esc closes the list and returns focus to the trigger.
  • Keyboard: Enter or Space on the trigger opens; type to filter the options; ArrowUp/ArrowDown move through the matches; Enter selects the highlighted option and closes; Esc closes without changing the value.

Props

PropTypeDefaultDescription
optionsrequiredComboboxOption[]—Selectable options. `label` is displayed and searched; `value` is reported to `onValueChange`.
valuestring | undefined—The currently selected option's `value` (controlled).
onValueChange((value: string) => void) | undefined—Called with the newly selected `value`, or an empty string when the current selection is toggled off.
placeholderstring | undefined"Select…"Text shown on the trigger when nothing is selected.
searchPlaceholderstring | undefined"Search…"Placeholder for the search input inside the dropdown.
emptyTextstring | undefined"No results found."Message shown when the search matches no options.
classNamestring | undefined—Extra classes applied to the trigger button.
idstring | undefined—`id` forwarded to the trigger button, for pairing with a `<Label htmlFor>`.
labelstring | undefinedthe `placeholder` textAccessible name for the trigger. The trigger carries `role="combobox"`, whose accessible name does *not* come from its own text — that text is read as the current value. Without a name, a screen reader announces the selected option with no indication of what it selects. Omit only when you have paired a visible `<Label htmlFor>` with `id`.

On this page