ToggleGroup
A group of toggle buttons for selecting one or multiple options. Chrome matches Tabs: default is a bordered track, outline is stroke-only, ghost is bare. Use gap for space between items — layout only, never chrome.
Default
Bordered recessed track — the usual segmented control.
Multiple selection
Outline
variant="outline" keeps the outer stroke but drops the track fill.
Ghost (with gap)
variant="ghost" has no rail. Pass gap={2} (spacing scale) or a CSS string for item spacing.
Sizes
sm and md — same tokens as Tabs / Button (h-8 / h-9).
Vertical orientation
Reference
ToggleGroup
Root. Extends base-ui ToggleGroup props.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "outline" | "ghost" | "default" | Bordered track / stroke-only / bare |
size | "md" | "sm" | "md" | Item height (md = h-9, sm = h-8); same tokens as Tabs / Button |
gap | number | string | — | Flex gap between items (number = spacing scale; string = CSS). Layout only — does not change chrome |
multiple | boolean | false | When true, more than one item can be pressed |
value | readonly any[] | — | Controlled pressed values (array) |
defaultValue | readonly any[] | — | Uncontrolled initial values (array; a bare string is coerced) |
onValueChange | (groupValue: any[], eventDetails) => void | — | Fires when the pressed set changes |
orientation | "horizontal" | "vertical" | "horizontal" | Layout direction |
disabled | boolean | false | Disable the whole group |
className | string | — | Merged onto the root |
ToggleGroupItem
One toggle in the group. Extends base-ui Toggle props. Size/chrome come from the parent group.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Value included in the group’s pressed array when on |