Frosted

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-frosted

About this component

A large switch with a frosted glass thumb: switching on slides the glass off a pink lamp, which flickers alight and streams its glow back along the dark track toward ON, lighting the glass's raised dots from behind.

Triggers

  • Click
  • State change
  • Glow

Techniques

  • Filter
  • Radial gradient
  • Keyframes
  • CSS transition
  • CSS variables

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, named by aria-label ("Studio light"); the drawn track and glass are aria-hidden, and :focus-visible on the input outlines the track.

Reduced motion

The glass jumps and the lamp comes on without flickering.

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

More toggles

See all
GelsGet code
LensGet code
NotifyGet code
PeachGet code