Skip to content
Components98 / 118

Eclipse Switch

A toggle that turns into a light show. The white knob winds back, springs across and eclipses into a black disc ringed by a neon corona, while liquid neon floods the track, sparks spray, the colours drift through yellow, green, pink and cyan, and it glows onto the surface with a soft reflection. Off, the colour drains back out.

SwitchToggleWebGL2NeonSquash & stretchGSAP
Flip the switch

Tweak

LIVE

Copy

Look

150px
1.00

Props

7 props
  • checkedboolean
    Controlled state.
  • defaultCheckedboolean
    Starting state when uncontrolled.default false
  • onCheckedChange(on) => void
    Called when it flips.
  • labelstring
    Accessible name for screen readers (no text is shown).default "Vivid mode"
  • sizenumber
    Track width in px (height follows).default 120
  • flownumber
    How fast the neon drifts, 0 to 2.default 1
  • classNamestring
    Extra classes.