- Components
- Forms
Toggle Group
A track of toggles. With a single selection one highlight slides to the pressed item; with multiple, every pressed item gets its own fill.
Installation#
npx shadcn add @ortaui/toggle-groupExamples#
Single (sliding highlight)#
Multiple#
API reference#
| Prop | Type | Default | Description |
|---|---|---|---|
| surface | "default" | "raised" | auto | Look on a panel. Unset: raised (page fill + border) inside any [data-surface] container. "raised" forces it anywhere; "default" keeps the muted fill even inside a surface. |
| value / defaultValue | string[] | - | Pressed item values. |
| multiple | boolean | false | Allow several pressed items; turns off the sliding highlight. |
| size | "sm" | "md" | "md" | Item height 28px or 32px. |
| onValueChange | (value: string[]) => void | - | Called when the selection changes. |