Skip to main content
ParticleUI

Magnetic Button

Button that elastically follows the cursor with a configurable magnetic strength. Snaps back on mouse leave.

Move cursor over the button

Installation

1

Run the CLI

$npx particleui-cli add magnetic-button

Usage

TSX
import { MagneticButton } from "@/components/ui/magnetic-button"

export default function Example() {
  return <MagneticButton strength={0.4}>Hover me</MagneticButton>
}

Props

PropTypeDefaultRequired
strengthnumber0.35no

Details

Source filecomponents/ui/magnetic-button.tsx
Typeui
Categoriesbuttons, particles
npm dependencies
Registry deps
Claude skill