Coil
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initToggleCoil(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/toggle-coilAbout this component
A playful switch whose thumb is a rainbow coil spring standing on the track: switching walks it to the other end like a spring toy on a stair, the top ring arcing over first and the rest pouring after it through an arch, landing stacked the other way up.
Triggers
- Click
- State change
- Delay stagger
- Keyframe
Techniques
- Keyframes
- CSS variables
- Stagger
- Transform only
Difficulty
Advanced
Accessibility
Keyboard and screen readers
A native checkbox with role="switch" inside a <label>, named by aria-label ("Playful motion"); the track and rings are aria-hidden, and :focus-visible on the input outlines the track.
Reduced motion
The coil appears at the other end without walking.
Use it in anything you build, commercial and client work included. Licence