Magnetic

Wraps a child element and pulls it toward the cursor when nearby. Smooth via GSAP's quickTo.

Usage

import { Magnetic } from '@bwo-ui/react';

<Magnetic strength={0.4} radius={140}>
  <button>Get started</button>
</Magnetic>

Props

PropTypeDefaultDescription
strengthnumber0.35How strongly the element follows the cursor (0 = none, 1 = full).
radiusnumber120Radius in px where the magnetic field is active.
durationnumber0.5Tween duration on each pointer update.
easestring'power3.out'GSAP ease.
childstringOptional child selector. When set, the transform is applied to the child instead of the wrapper — useful when the wrapper has hover effects you want to stay in place.