Motes

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-motes

About this component

A sunbeam switch: switching on lets a slanting shaft of light in across the track with dust drifting in it, and the thumb slides out of the shade into the beam and lights up.

Dependencies
None
Difficulty
Intermediate
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers4

  • Click
  • State change
  • Loop
  • Glow

Techniques3

  • Keyframes
  • Gradient
  • CSS transition

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, so Space toggles it and the visible text names it; :focus-visible on the input outlines the track, which is aria-hidden.

Reduced motion

The dust holds still.

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

More toggles

See all
PatinaGet code
PegboardGet code
PinchGet code
PistonGet code