Get the kit
Components / Interactionsv1.0.0 · updated 2026-10-04

Magnetic Button

Premium · $19

Wrap a button, link or icon and it drifts toward the cursor when it comes within range, then springs home. Strength, radius and smoothing are tunable, and it runs on the shared loop instead of its own requestAnimationFrame.

cursorbuttonhover
Premium
Bring the pointer within 80px
Customize
Accent

Install

No dependencies beyond React. Copy the file and import it.

  1. Download the package from your library after purchase and add it to your project.
  2. Make sure the Brazen tokens are loaded (tokens.css); colours and timing come from them.
  3. Import it and pass the props below.

Props 3

PropTypeDefaultDescription
strengthnumber0.35How far it follows, 0–1.
radiusnumber80Pull distance beyond the element edge, in px.
smoothingnumber0.18Per-frame lerp factor; lower is floatier.

Features

  • Strength, radius and smoothing
  • Works on any child
  • Pauses off-screen
  • Skipped on touch screens

Dependencies

  • react@>=19 peer

Works with

  • React 19
  • Next.js 15+
  • TypeScript

Reduced motion

Stays still.

Related