Frosted
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initToggleFrosted(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-frostedAbout 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