A set of toggles, one or many on, joined or spaced, outline or ghost. On is inverted.
Toggle group single
Install
npx shadcn add @syncrobotic/toggle-group Also installs: radix-ui, @syncrobotic/cn
Overview
A row of toggle buttons where one (single) or several (multiple) can be on.
When to use
- Time ranges, view modes and filters with a single choice.
- Map layers or notification channels where any mix is on.
Use something else
- Switching views of the same data on a muted track: Segmented control.
- One on/off: Toggle.
- A form choice saved on submit: Radio group or Checkbox.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Toggle group multiple layers
Toggle group icon only
Toggle group ghost
Toggle group spaced
Toggle group channels
Toggle group sort direction
Toggle group vertical
Usage rules
- type="single" for one choice, type="multiple" for layers or channels.
- On is inverted, like a selected segment.
- Icon-only items need an aria-label.
Changelog
- 0.17.32026-11-19Two adjacent selected items keep a divider; ghost items keep their rounded corners with a 4 px gap.
- 0.10.02026-11-18Disabled keeps its words readable: a grey field (bg-muted, muted text) on controls with a surface, solid disabled ink on items and icons; no more 50 % opacity, which washes text out in sunlight.
- 0.9.02026-11-17New.