Bead

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-bead

About this component

A switch whose track is printed with pastel stripes under a coat of glass, and whose thumb is a clear glass bead that magnifies the stripes beneath it as it rolls across; on, the stripes come into full colour.

Triggers

  • Click
  • State change
  • Gradient

Techniques

  • Gradient
  • CSS transition
  • CSS variables

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, named by aria-label ("Colour").

Reduced motion

The transitions and loops stop and the component jumps straight to its final state.

Use it in anything you build, commercial and client work included. Licence

More toggles

See all
CoilGet code
DelftGet code
FrostedGet code
GelsGet code