ToggleGroup
v1.0.5Updated 4 Oct 2026Two-state toggle buttons built on Radix Toggle / ToggleGroup. Ships a standalone Toggle (aria-pressed) plus a ToggleGroup with single or multiple selection — ideal for view switchers, list-page status filters and formatt
Preview
Live · 14 stories▸Why this is recommendedtogglesegmentedfilterpressed+3
The default, out-of-the-box ToggleGroup.
- ✓View-mode switchers (list / grid / table)
- ✓Status filters on list pages
- ✓Rich-text formatting toolbars
- ✓Report period selectors (day / week / month)
- Standalone Toggle with aria-pressed (Space/Enter)
- Group single or multiple selection
- Controlled and uncontrolled (value / defaultValue / onValueChange)
- Variants: default (joined outline segments) / soft (segmented control on muted track)
- Sizes sm / default / lg
- Six recipe tones for the pressed state, per-item tone overrides
- Roving-tabindex arrow-key navigation, Home/End
- Horizontal or vertical orientation
- Icon-only items (aria-label required)
- Labelled by FormField: the div role=group (not labelable) points at the field label with aria-labelledby; aria-required is dropped (not allowed on a group or its items)
- ✕Page navigation (use Tabs)
- ✕On/off settings rows (use Switch)
- ✕Exclusive form fields with labels/descriptions (use RadioGroup)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
typeSelection mode (ToggleGroup only)
yesvalueControlled value(s)
—defaultValueUncontrolled initial value(s)
—onValueChangeSelection change callback
—variantJoined outline segments or muted segmented control
—sizeItem height (h-7 / h-8 / h-9)
—toneAccent of the pressed state (shared recipe)
—orientationLayout direction + arrow-key axis
—aria-labelledbyId(s) of the element(s) that label the group; wins over a FormField label
—aria-labelAccessible name of the group; wins over a FormField label
—Every tonal component shares the same tone × emphasis API, so the pair looks identical across Button, Badge, Alert and more.