Components / component

Magnetic Pull Button

A solid pill that leans toward the pointer as it approaches, with the label moving further than the body, then springs back.

Magnetic Pull Button demo

Implementation

A solid pill that leans toward the pointer as it approaches, with the label moving further than the body, then springs back.

Framework
React 19.3.1 with TypeScript
Motion
Native CSS and browser APIs. No GSAP required.
Available modes
build
Version
1.0.0 · published

Source code

Loading source…

Quality evidence

Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .

Changelog

v1.0.0 · A solid pill that leans toward the pointer as it approaches, with the label moving further than the body, then springs back.

Frequently asked questions

What happens on touch screens or with a keyboard?

No pull happens on touch, pen or keyboard. Only a mouse pulls the button, and reduced motion removes the movement. The button still works as a normal button everywhere.

Will the pull zone overlap nearby elements?

The pull begins 36 px outside the button, but a negative margin keeps the layout the size of the button. Leave a little space around it so the zone does not sit over neighboring controls.