Coil

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-coil

About 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

More toggles

See all
DelftGet code
FrostedGet code
GelsGet code
LensGet code