Magnetic Cursor

Visual Effects

A wrapper that creates a magnetic pull effect, attracting elements toward the cursor with configurable strength and radius.

Loading preview...
Customize
Strength
0.3
Radius (px)
200

Props

PropTypeDefaultDescription
childrenReact.ReactNodeThe element to apply the magnetic effect to.
classNamestring''Additional CSS classes.
strengthnumber0.3Magnetic pull strength (0 = none, 1 = follows cursor fully).
radiusnumber200Pixel radius of the magnetic field.
springConfig{ stiffness?: number; damping?: number }{ stiffness: 150, damping: 15 }Spring physics configuration for the animation.