Component packs › Hover FX › Magnetic Button

Magnetic Button

The button pulls toward your cursor before you reach it; the label travels further than the body.

Magnetic Button is a button from Hover FX, a component pack with 6 components: The fastest way to make a site feel premium. Price: $2 for the whole pack.

Built with: pull radius, label parallax, pointer light.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Magnetic Button props

PropTypeDefaultDescription
labelstring
radiusnumber90Pull radius around the button in px. Default 90.
onClick() => void
autoplaybooleanShowcase mode: an invisible cursor orbits it.

Methods on the ref

Use it in React

import MagneticButton from './MagneticButton';

<MagneticButton />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Hover FX

Good for: Micro-interactions.