The MagneticWrapper component adds an engaging interactive effect to child elements, simulating a magnetic attraction-like motion that follows the user's cursor.
Installation
Examples
Props
Prop | Type | Description | Default |
---|---|---|---|
children | ReactElement | The child element that will have the magnetic interaction applied. | - |
animationDuration | number | Duration of the magnetic effect animation in seconds. | 1 |
elasticity | number | Elasticity factor controlling the bounciness of the magnetic effect. | 0.3 |