Micro-interactions

Magnetic Button

A button that leans into your cursor — caught in a magnetic field it slides toward the pointer while an amethyst aura swells with proximity, then snaps home on a spring and answers every click with a dark ripple bursting outward from the point of contact.

Install

bun add motion

Props

PropTypeDefaultDescription
pullStrengthnumber0.4Fraction of the cursor offset the button follows.
radiusnumber120Field radius where the magnetic pull begins.
stiffnessnumber260Spring stiffness of the pull and return.
dampingnumber18Spring damping — lower overshoots and rings.
auraColorstring (hex)"#a855f7"Color of the proximity glow.
auraSizenumber80Spread of the aura at full proximity.
ripplebooleantrueEmit a dark ripple burst on click.
rippleColorstring (hex)"#d2abfd"Color of the click ripple.

What It Demonstrates

Hover effect
Visual change when the cursor moves over an element.
Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Ripple
A circle expanding from the point of a tap, confirming the press.
Press / Tap feedback
A subtle scale-down when an element is clicked, so it feels physical.
Momentum
Motion that carries velocity, especially after a drag or interruption.

Related Components

Appears In