Pixel

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-pixel

About this component

An 8-bit switch. Chunky pixel corners, a square thumb with a highlight pixel, and movement that jumps in five hard steps instead of gliding, with the track filling in a checker pattern a step behind it, like a sprite on an old console. Pure CSS (steps() timing).

Triggers

  • Click
  • State change

Techniques

  • Keyframes
  • CSS transition

Difficulty

Beginner

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
RockerGet code
RotaryGet code
SeesawGet code
ShifterGet code