ONONC

Magnet

Wraps any element so it springs toward the pointer within an activation radius.

pointermotionspring

Styled with ONONC's design tokens shadcn add installs them for you.

Customize

Magnet

Activation radius120px
Strength0.4

Fraction of the pointer offset followed.

Max travel40px
Disabled

Spring

Stiffness200
Damping18

Props

PropTypeDefaultDescription
children*ReactNodeContent the magnet effect wraps; keeps its own semantics.
paddingnumber120Activation radius (px) around the element's bounds.
strengthnumber0.4Fraction (0–1) of the pointer offset the element follows.
maxTranslatenumber40Maximum translation in either axis, in pixels.
springStiffnessnumber200Spring stiffness driving the follow motion.
springDampingnumber18Spring damping driving the follow motion.
disabledbooleanfalseDisable the magnet effect entirely.
classNamestringClass name for the outer, non-moving wrapper.
innerClassNamestringClass name for the inner, moving element.