Toggle Group
Displays a toggle group built on the Base UI Toggle Group primitive.
Installation
Bash
Usage
Multiple Selection
Examples
Multiple
An outline, multi-select formatting group — multiple allows several
pressed items at once.
API reference
ToggleGroup
Extends the
Base UI Toggle Group
primitive — all its props apply. The value is always an array of
strings, even in single-selection mode
(defaultValue={["center"]}). variant and size cascade to every
item.
| Prop | Type | Default |
|---|---|---|
multiple | boolean | false |
value / defaultValue | string[] | — |
onValueChange | (value: string[]) => void | — |
variant | "default" | "outline" | "default" |
size | "default" | "sm" | "lg" | "default" |
spacing | number — gap between items | 2 |
orientation | "horizontal" | "vertical" | "horizontal" |
ToggleGroupItem
Extends the Toggle component — requires a
value; variant and size come from the group. Give icon-only items an
aria-label.