Magnetic Pull
Wraps anything so it is pulled toward the pointer on a spring when the pointer comes close, and springs back when it leaves.
pixikit.com/docs/effects/magnetic-pull
Customize
Padding100px
Magnet strength2.0
Exclusive
Axis
Tilt6°
Scale1.00
Stiffness170
Damping16
Mass1.0
Disabled
Props
16| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | None | What gets pulled toward the pointer. |
padding | number | 100 | Distance in pixels around the element where the pointer starts to pull it. |
magnetStrength | number | 2 | How far it follows the pointer: the offset is divided by this, so 1 follows the pointer and higher values move less. |
exclusive | boolean | true | With several magnets in range, only the nearest exclusive one is pulled; turn it off to let a group lean together. |
axis | "both" | "x" | "y" | "both" | Limits the movement to one axis. |
maxOffset | number | None | Caps how far it can move from its resting place, in pixels. |
tilt | number | 0 | Maximum 3D tilt toward the pointer, in degrees. |
scale | number | 1 | Scale of the element while the pointer pulls it. |
stiffness | number | 170 | Spring stiffness: higher reacts faster. |
damping | number | 16 | Spring damping: lower lets it overshoot and wobble back. |
mass | number | 1 | Spring mass: higher feels heavier. |
disabled | boolean | false | Turns the pull off and lets the element spring back to rest. |
onActiveChange | (active: boolean) => void | None | Called when the pointer enters or leaves the magnetic area. |
wrapperClassName | string | None | Class for the outer wrapper, which stays in place. |
innerClassName | string | None | Class for the inner element that moves. |
style | CSSProperties | None |