Motion Library ‹ Free tools

All / Hover

Magnetic button

The button is gently pulled toward the cursor while hovered, then springs back when you leave.

CSSJavaScriptIntermediate
Live demo Open full screen

Good for

Primary calls to action on portfolio and agency style sites.

Watch out for

Only enable on devices with a real hover pointer, and keep the pull small (a few pixels), or it feels broken.

Accessibility

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