Switch
@sushindustries/uiA checkbox that admits it: a real input with role=switch, and a track :checked drives.
Switch is a checkbox that admits what it is: a real input carrying
role="switch", drawn as a track and thumb on its label. Reach for it for a
setting that takes effect the instant it is toggled, not one that waits for a
form to be submitted.
tanstacktanstack add https://adamjurek.com/r/tanstack/switch.jsonpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/switch.jsonWhy it is built this way
role="switch" without a managed aria-checked is a promise half kept, so
the input underneath stays a genuine, native checkbox rather than a styled
div faking the semantics - announced honestly, with the track and thumb
driven by :checked rather than by React state.
Install
tanstack add https://adamjurek.com/r/tanstack/switch.jsonshell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/switch.jsonshell
pnpm add @sushindustries/ui @sushindustries/atomsshell
What you get
| Version | 0.1.0 |
| Category | content · Forms |
| Files | switch.tsx |
| Dependencies | None |
| Tags | form, toggle, no-deps |
No runtime dependencies
It brings nothing with it beyond the stylesheet.