Get GliaKit

Forms

Combobox

A searchable select: an input-styled trigger opens a popover that filters options as you type.

Source
src/components/ui/combobox.tsx
Figma
Combobox · state (closed, open)

Usage

Included in the GliaKit boilerplate. Import it where you need it:

tsx
import { Combobox } from "@/components/ui/combobox";

When to use

  • Picking one value from a long list: countries, time zones, team members, repositories.
  • Any select where people already know what they are looking for and would rather type than scroll.
  • For short lists (under about 10 options), use Select.
  • For choosing several values, pair a list of checkboxes or Chips instead; Combobox selects one value.

Examples

Long list

Where Combobox earns its place: a list too long to scroll. Type "europe" or something with no match.

In a form

Inside a Field, next to other inputs. The placeholder doubles as the trigger's accessible name, so make it descriptive.

Disabled

The trigger dims and will not open.

API reference

Combobox

Single-select only. Does not spread native props. Exports the ComboboxOption type ({ value: string; label: string }).

PropTypeDefaultDescription
optionsComboboxOption[]-Required. The full list; filtering by label happens inside.
valuestring-The selected option's value. Controlled only: hold it in state.
onValueChange(value: string) => void-Called with the picked option's value. The popover then closes.
placeholderstring"Select option"Trigger text when nothing is selected.
searchPlaceholderstring"Search…"Placeholder for the search field in the popover.
disabledboolean-Disables the trigger.
classNamestring-Classes for the trigger button.

Accessibility

  • The popover is Radix Popover: Escape or clicking outside closes it and focus returns to the trigger.
  • The search field is focused when the popover opens. Arrow Up and Down move the highlight, Enter picks it.
  • The trigger has aria-expanded. Its accessible name is the visible text (the selected label or the placeholder), so write a descriptive placeholder such as "Select time zone".
  • There is no aria-label prop and options are plain buttons without listbox semantics, so the highlighted option is not announced while arrowing. For screen reader heavy flows, prefer Select.

Related