Bumper

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-bumper

About this component

The track has rubber stops at both ends: the thumb runs into the far one, squashes it flat and is pushed back out, bouncing a little before it settles.

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

Triggers4

  • Click
  • State change
  • Spring
  • Keyframe

Techniques2

  • Keyframes
  • Transform only

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 thumb moves without the bounce.

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

More toggles

See all
ConfirmGet code
HapticGet code
KnockoutGet code
Click to save as you type
PeekGet code