DIP

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-dip

About this component

A debug switch drawn as a DIP switch off a circuit board: a dark package with legs along both edges and ON printed beside the well, its ribbed slider snapping from one end to the other into a detent.

Dependencies
None
Difficulty
Intermediate
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers2

  • Click
  • State change

Techniques3

  • Keyframes
  • Gradient
  • Pseudo elements

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, so Space toggles it and the visible text names it; :focus-visible on the input outlines the track, which is aria-hidden.

Reduced motion

The slider moves without the click.

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

More toggles

See all
DoodleGet code
FrictionGet code
GlyphGet code
HingeGet code