Switch default
Install
npx shadcn add @syncrobotic/switch Also installs: radix-ui, @syncrobotic/cn
Overview
On or off for a setting that takes effect the moment it changes, with no save button.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Switch settings list
Switch with description
Switch disabled
Usage rules
- Takes effect immediately; no save button.
- On is the primary colour, like every selected control; never green (green is a confirmation that just happened, not a setting).
Changelog
- 0.17.12026-11-19Off is drawn with the --input edge, 3:1 on its surface (it was the --border edge, 1.3:1).
- 0.12.02026-11-18Disabled is never faded: when on, the track goes grey instead of the primary. The hit area is the --h-md token, so it grows with glove density.
- 0.9.02026-11-17Description and doc comment corrected: on is the primary colour, not success green.