Candle

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-candle

About this component

A candle as a switch. Switching on, the flame swells up off the wick with a warm glow around it and keeps flickering; switching off snuffs it, and a thin wisp of smoke curls up from the wick and fades.

Triggers

  • Click
  • State change
  • Glow
  • Loop

Techniques

  • Keyframes
  • Radial gradient
  • CSS transition

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

Native checkbox with role="switch" inside a <label>. The visible label text names it. Focus ring on the visual via :focus-visible.

Reduced motion

The change is instant and the script skips its animation.

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

More toggles

See all
Caps LockGet code
Pull CordGet code
EyeGet code
FanGet code