Combobox
Search and select from a list without leaving the field.
npx shadcn@latest add @silicon-ui/comboboxInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/comboboxManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/combobox/combobox.tsx
- components/silicon-ui/combobox/combobox.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
label* | string | — |
options* | ComboboxOption[] | — |
value | string | — |
defaultValue | string | "" |
onValueChange | (value: string) => void | — |
description | string | — |
placeholder | string | "Search or select…" |
emptyMessage | string | "No matches found" |
className | string | — |
Also accepts the props of InputHTMLAttributes<HTMLInputElement>, except value, defaultValue, onChange, placeholder.
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens