Skip to content
Design System
GitHub

On is the primary colour, off a neutral track; takes effect immediately.

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.

When to use

  • Notifications on, auto-dock on low battery, dark mode.

Use something else

  • A choice that is saved with a form: Checkbox.
  • Showing a layer or panel: Toggle.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Recommended
IP67, but slower on wet ground
Turns on below 10 lux

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.

How to upgrade