Back
Magnetic Button
Satu Visual ComponentNew
A button that's magnetically pulled toward the cursor on hover.
Installation
Add it with the CLI:
Terminal
$
Or open the Code tab above and copy it in manually — it relies on the standard cn() helper from @/lib/utils.
Usage
Forwards all native button props. The pull resets when the cursor leaves.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Button content. |
| strength | number | 0.4 | Pull strength (0–1). |
| className | string | — | Extra classes. |
| ...props | ButtonHTMLAttributes | — | Native <button> props. |