Component packs › Coil › Spring Toggle
The thumb flies across on a stretching coil, bounces off the far stop and latches; off, the coil pulls it home in swings.
Spring Toggle is a toggle from Coil, a component pack with 6 spring controls: Controls on real coil springs: they compress, stretch, overshoot and settle like wire does. Price: $2 for the whole pack.
Built with: coil anchored to the track, hard stops, overshoot.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | ||
disabled | boolean | ||
label | string | "Toggle" | Accessible name. Default "Toggle". |
onChange | (checked: boolean) => void |
readonly checked: booleansetChecked(checked: boolean, silent?: boolean): voiddestroy(): voidimport SpringToggle from './SpringToggle';
<SpringToggle />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Buttons.