Toggle
v0.10.0An on/off button for a layer or option. On is inverted, like a selected segment.
Toggle layers
Install
npx shadcn add @syncrobotic/toggle Also installs: radix-ui, @syncrobotic/cn
Overview
A button that stays pressed: on or off for one thing, such as a map layer.
When to use
- Showing or hiding a layer, a column or a panel.
- Toolbar options like bold or follow robot.
Use something else
- A setting that applies immediately and persists: Switch.
- One choice among several: Segmented control.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Toggle sizes
Toggle icon only
Toggle with icon
Toggle disabled
Usage rules
- On/off for one thing, such as an image or map layer. On is inverted.
- For one choice among several, use Segmented control; for a setting that applies at once, use Switch.
Changelog
- 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.6.02026-11-17First release. Presses.