Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/ToggleGroup

ToggleGroup

Grouped toggles with single or multiple selection and preserved semantics.

Base UI reference ↗

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add toggle-group

Dependencies

What add toggle-group installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

npm

Examples

4 examples · 1 component
toggle-group

Single choice

Text alignment: one pressed item at a time.

toggle-group

Multiple choice

multiple lets formatting options combine.

toggle-group

Segmented control

variant="outline" joins the items; text items read on their own.

toggle-group

Vertical

orientation="vertical" stacks the items; up and down arrows move.

API reference

Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.

PropTypeDefault
value / defaultValue

Pressed items, always an array (one item unless multiple).

string[]—
onValueChange

Called with the new pressed items.

(value: string[]) => void—
multiple

Lets several items be pressed at once.

booleanfalse
variant

outline joins the items into one segmented control.

"default" | "outline""default"
size

Applied to every item.

"sm" | "default" | "lg""default"
orientation

Stacks the items and switches arrow keys to up/down.

"horizontal" | "vertical""horizontal"
ToggleGroupItem

One toggle; value is required.

button—

States

The states that apply to this component and their visual treatment.

StateTreatment
SinglePressing an item releases the previous one; it can be released to none.
MultipleItems toggle independently.
Joinedvariant="outline" shares borders; the focused item rises above its neighbours.
DisabledOn the group or on single items; disabled items are skipped by the arrow keys.

Accessibility

The group is one Tab stop: arrow keys move between items (roving focus) and Space or Enter presses the focused one.

Name the group with aria-label or aria-labelledby, and each icon-only item with its own aria-label.

Every item keeps aria-pressed, so assistive tech reports each state, in single and in multiple mode.

Use RadioGroup when a choice must always have exactly one answer in a form; ToggleGroup fits toolbars and view options.