Skip to content

Combobox

Search and select from a list without leaving the field.

FieldSearch
npx shadcn@latest add @silicon-ui/combobox

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/combobox

Manually

  1. Install the dependencies

    npm install lucide-react motion
  2. Copy 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
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { Combobox } from "@/components/silicon-ui/combobox/combobox";

API reference

PropTypeDefault
label*string—
options*ComboboxOption[]—
valuestring—
defaultValuestring""
onValueChange(value: string) => void—
descriptionstring—
placeholderstring"Search or select…"
emptyMessagestring"No matches found"
classNamestring—

Also accepts the props of InputHTMLAttributes<HTMLInputElement>, except value, defaultValue, onChange, placeholder.

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokens