Theme toggle
v0.10.1Light, match the system, or dark: three icon segments, the current one inverted, each named for screen readers.
Theme toggle basic
Install
npx shadcn add @syncrobotic/theme-toggle Also installs: lucide-react, @syncrobotic/cn, @syncrobotic/segmented-control
Overview
When to use
- Settings, or the corner of an app's top bar.
Use something else
- A single on or off: Switch.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Theme toggle unknown
Usage rules
- Three choices: light, match the system, dark. With no stored choice the app's default applies: light (:root).
- Pass undefined until the stored choice is known, so nothing is shown selected and then jumps.
- In a top bar, at the far right beside the user.
Changelog
- 0.10.12026-11-21No unused React import, so the file compiles in projects with noUnusedLocals.
- 0.10.02026-11-18New.