An autocomplete text field with a filterable listbox (single value or multi-select chips), drawn as an inset Aqua search well with a translucent white menu and blue full-width highlight.
Installation
Requires the theme. Register the @skeuomorph namespace and add @skeuomorph/skeuomorph first, as shown in the installation guide. The CLI also pulls it in as a dependency.
Without the namespace, install straight from the URL:
Usage
import {
Combobox,
ComboboxContent,
ComboboxEmpty,
ComboboxInput,
ComboboxItem,
ComboboxList,
} from "@/components/ui/combobox"const fonts = ["Lucida Grande", "Helvetica", "Geneva", "Monaco", "Optima"]
export function FontCombobox() {
return (
<Combobox items={fonts} defaultValue="Helvetica">
<ComboboxInput placeholder="Font" aria-label="Font" showClear />
<ComboboxContent>
<ComboboxEmpty>No fonts found.</ComboboxEmpty>
<ComboboxList>
{(item: string) => (
<ComboboxItem key={item} value={item}>
{item}
</ComboboxItem>
)}
</ComboboxList>
</ComboboxContent>
</Combobox>
)
}Multiple values
Pass multiple and render the selection as address tokens with ComboboxChips. Anchor the menu to the chips row with useComboboxAnchor.
API
Composition
The examples below do not use combobox.tsx. They build a combobox from Popover and Command instead, which is handy when you want a button trigger or a searchable menu. Install them with npx shadcn@latest add @skeuomorph/popover @skeuomorph/command @skeuomorph/button.