Combobox
A searchable select built from Popover and Command. Single or multiple, groups, descriptions, icons and animated badges.
Inputs
Playground
Tweak the props, the preview and the code follow.
Props
const options = [
{ value: "next", label: "Next.js" },
{ value: "astro", label: "Astro" },
// …
]
<Combobox options={options} placeholder="Select a framework" />Installation
Usage
import { Combobox } from "@/components/ui/combobox"<Combobox
options={[
{ value: "next", label: "Next.js" },
{ value: "astro", label: "Astro" },
]}
placeholder="Select a framework"
/>Examples
Multiple
Selected items become badges you can remove inline.
2 reviewers will be notified.
Groups
API Reference
Combobox
| Prop | Type | Default |
|---|---|---|
options*The choices. | { value, label, description?, icon?, group?, disabled?, keywords? }[] | — |
multipleSwitch `value` to `string[]`. | boolean | false |
value / defaultValueSelected value(s). | string | string[] | — |
onValueChangeCalled on selection. | (value) => void | — |
placeholderTrigger text when empty. | string | "Select…" |
searchPlaceholderSearch field placeholder. | string | "Search…" |
emptyTextShown when nothing matches. | ReactNode | "No results." |
maxBadgesWith `multiple`, badges shown before +n. | number | 3 |