Spring Toggle
FREEA switch with a little squish in its step.
React 19Tailwind 4motionadded 2026-11-28
live preview · spring toggle
Installation
Into your bowl in one line.
The CLI drops the source straight into your project. You own every line; there’s no package to update.
- 01
Add it with the CLI
$ npx bowls@latest add spring-toggle - 02
Or go manual: install the one dependency
npm i motion - 03
Serve it
Paste the source into
components/bowls/spring-toggle.tsxand import it — the Code tab’s demo.tsx shows a full example.
Props
| PROP | TYPE | DEFAULT | WHAT IT DOES |
|---|---|---|---|
| label | string | — | Accessible name for the switch. |
| checked | boolean | — | Controlled state. |
| defaultChecked | boolean | false | Initial state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | — | Called on every change. |
| size | "sm" | "md" | "lg" | "md" | Switch size. |