FREE / MOTION
Magnet
Magnet is a reusable animations reference prepared for the MADLAB library. Explore the live behavior, understand the implementation, and take the source into your own project.
- Difficulty
- Intermediate
- Build time
- 30–90 minutes
- Category
- ANIMATIONS
- Status
- MADLAB preview + local source
MADLAB / WORKSPACE
Build it, then tune it.
Move inside the preview to test the interaction. Open Code when you are ready to adapt the local source.
02 / API surface
Props & source.
The useful details stay visible beside the experiment: what it is, where it lives, and which values are safe to change.
- Component
- Magnet
- Source path
- src/ts-tailwind/Animations/Magnet/Magnet.tsx
- Stack
- React / TypeScript / Tailwind CSS
- Controls
- Primary, light, and deep values are mapped to MADLAB controls.
- Accessibility
- Keep the surrounding label and non-motion fallback when integrating.
03 / Integration notes
Make the reference yours.
Use the preview to understand the visual rule, then keep only the behavior that earns its place in your interface. The local source remains available for every catalog item.
04 / Full tutorial
Build Magnet from zero.
A complete, step-by-step breakdown of Magnet: from the static contract to a proximity field that pulls an element toward the pointer, responsive behavior, accessibility, and production tuning.
MADLAB / archive