Split Flap

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-flap

About this component

A departures board that reads OFF or ON. Switching clatters each letter through a few flaps on its own beat before it lands, top half falling and bottom half dropping into place; a letter that doesn't change stays put, as on a real board.

Triggers

  • Click
  • State change
  • Delay stagger
  • 3D

Techniques

  • 3D transform
  • Perspective
  • Stagger
  • State machine

Difficulty

Advanced

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
Neon SignGet code
PadlockGet code
PixelGet code
RockerGet code