Plankton

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-plankton

About this component

A night light switch on a strip of dark sea: pushing the wet pebble through the water stirs the plankton, which flash blue-green in its wake and stay twinkling while on; off, they flash once more and go dark.

Triggers

  • Click
  • State change
  • Glow
  • Delay stagger
  • Ambient

Techniques

  • Keyframes
  • CSS variables
  • Stagger
  • Radial gradient

Difficulty

Advanced

Accessibility

Keyboard and screen readers

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

Reduced motion

The pebble jumps and the sparks show without flashing or twinkling.

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

More toggles

See all
StandbyGet code
TideGet code
TileGet code
TubeGet code