Chip group
Filter by a few facets with chips that morph as you pick them.
npx shadcn@latest add @silicon-ui/chip-groupInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/chip-groupManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/chip-group/chip-group.tsx
- components/silicon-ui/chip-group/chip-group.module.css
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 |
|---|---|---|
options* | ChipOption[] | — |
value* | string[] | — |
onValueChange* | (value: string[]) => void | — |
label*Accessible name of the group, such as “Topics”. | string | — |
multipleAllow several chips at once. In single mode the selected chip can still be cleared. | boolean | true |
maxVisibleChips shown before the rest fold behind a “+N more” chip. Chips selected when it folds stay in view. | number | Infinity |
className | string | — |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens