Select
A compact choice field with a keyboard friendly menu.
npx shadcn@latest add @silicon-ui/selectInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/selectManually
Install the dependencies
npm install @radix-ui/react-select lucide-react motionCopy these files into your project
- components/silicon-ui/select/select.tsx
- components/silicon-ui/select/select.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/menu-highlight.tsx
- 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* | { value: string; label: string; disabled?: boolean }[] | — |
description | string | — |
placeholder | string | "Select an option" |
id | string | — |
className | string | — |
Also accepts the props of ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, except children.