Installation
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
particleCount | number | 12 | Number of particles to display around the button |
attractRadius | number | 50 | Radius in pixels for particle placement |
className | string | - | Additional CSS classes |
Dependencies
motion/react(Framer Motion) - For particle attraction animationslucide-react- For the Magnet icon@/components/ui/button- Base button component@/lib/utils- Utility functions (cn)
Features
- Magnetic particle animation on hover/touch
- Customizable particle count
- Spring physics for smooth animations
- Touch-friendly interactions
- Particles scatter when not hovering
- Icon scales on interaction
- Dark mode support
- Violet color scheme