Skip to content
Interactive

MagneticCursor

A ring replaces the mouse cursor inside an area. Over a link or button it snaps on and takes that element's shape, leaning a little toward the pointer. Touch and reduced motion keep the normal behaviour.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
childrenReactNode—The area that gets the custom cursor.
selectorstring"a, button, [data-magnetic]"What the ring wraps around.
sizenumber28Ring size in pixels when it is not on a target.
paddingnumber8Pixels between the ring and the target it wraps.
pullnumber0.2How far the ring leans toward the pointer on a target, 0 to 1.
accentstring"#a78bfa"Ring colour.
classNamestring""On the area wrapper.