Airplane

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-airplane

About this component

Airplane mode where the thumb is the plane. Switching on, it races down the track, noses up to climb and leaves a dashed contrail behind it; switching off, it levels out and taxis back as the contrail fades. Pure CSS on a native switch.

Triggers

  • Click
  • State change
  • Icon

Techniques

  • Keyframes
  • SVG
  • 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.

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

More toggles

See all
ApertureGet code
BeamGet code
BlindsGet code
CandleGet code