Radio cards
Selectable option cards with a sliding selection ring, price and description slots, and radio keyboard behavior.
Switch between a small set of related views.
npx shadcn@latest add @silicon-ui/segmented-controlnpx shadcn@latest add @silicon-ui/segmented-controlInstall the dependencies.
npm install motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/segmented-control/segmented-control.tsxcomponents/silicon-ui/segmented-control/segmented-control.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
options* | Segment[] | — |
value* | string | — |
onValueChange* | (value: string) => void | — |
label | string | — |
onOptionIntentCalled when the pointer or focus reaches an option, before it is chosen. Use it to start loading what that option shows. | (value: string) => void | — |
size`sm` (default) or `xs`, a compact 24px control for dense UI such as an Edit/Read toggle in a toolbar. | "sm" | "xs" | "sm" |
className | string | — |