Shifter

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-shifter

About this component

A gear stick in a gated plate. Switching on drives the knob out of P along its slot, round the corners and down into D, which lights up; off takes it back the same way. Pure CSS: the knob rides an offset-path drawn to match the groove.

Triggers

  • Click
  • State change

Techniques

  • 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
SleepGet code
ZipperGet code