Skip to content

Select

A compact choice field with a keyboard friendly menu.

FieldForm
npx shadcn@latest add @silicon-ui/select

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/select

Manually

  1. Install the dependencies

    npm install @radix-ui/react-select lucide-react motion
  2. Copy 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
  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 { Select } from "@/components/silicon-ui/select/select";

API reference

PropTypeDefault
label*string—
options*{ value: string; label: string; disabled?: boolean }[]—
descriptionstring—
placeholderstring"Select an option"
idstring—
classNamestring—

Also accepts the props of ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, except children.

Dependencies

npm
@radix-ui/react-selectlucide-reactmotion
Registry
silicon-motion-tokens