Combobox

Autocomplete on Command-inside-Popover. The panel springs open on scale and opacity; option focus moves in a crisp highlight step rather than a fade — keep the keyboard the primary affordance.

Install

import { Combobox } from '$lib/components/ui/combobox';
Custom

Usage

States

Preselected
Disabled

Popover composition

When the prebuilt Combobox isn't flexible enough, compose Popover + Command directly. This gives full control over grouping, footers, custom items, and trigger shape.

DropdownMenu + Command gives searchable items inside a menu surface — useful when the combobox lives inside a toolbar or action bar where a popover anchor is awkward.

Responsive

On mobile a bottom Drawer replaces the floating popover — a more thumb-reachable surface on narrow viewports. A matchMedia rune switches the surface at the md breakpoint.

API reference

Wraps Popover + Command under the hood. The options prop is the fast path; drop to direct Command composition when you need grouped or footer-rich menus.

PropTypeDescription
ComboboxOption[]Array of { value, label, disabled?, keywords? }. Keywords feed the Command search filter.
string (bindable)Selected option value. Selecting the active option again clears it.
boolean (bindable)Two-way bindable popover open state.
stringTrigger label shown when value is empty.
stringPlaceholder inside the Command input.
stringRendered inside Command.Empty when filtering returns nothing.
booleanDisables the trigger button.
stringAdditional classes merged onto the trigger Button.
stringAdditional classes merged onto the Popover.Content panel.