Motion Library ‹ Free tools

All / Micro-interactions

Toggle switch

A switch whose knob slides and squishes slightly, with the track colour easing between states.

CSSBeginner
Live demo Open full screen

Good for

Settings screens and on/off controls. Built on a real checkbox so it works with keyboards and screen readers.

Watch out for

Hide the checkbox visually, never with display none, so it stays focusable.

Accessibility

Wrap motion in @media (prefers-reduced-motion: reduce) and switch it off or shorten it for people who ask for less movement.