Report a problem or share feedback← Catalog
Follow pointer with spring
curatedfreemotion/follow-pointer-with-spring
An example of making an element follow the pointer with a spring using Motion for React's useSpring hook.
$
pnpm add motion # then adapt the free source from https://motion.dev/examples/react-follow-pointer-with-springnpm deps: motion
Our notes
Element that follows the cursor with spring lag — custom cursors and spotlight followers without Motion+ Cursor. Free example (motion is MIT); copy and adapt the source from the example page.
- Source
- Motion (motion.dev)
- Kind
- transition
- Categories
- transition, cursor
- Use as
- recipe — technique you apply to your own markup
- Applies to
- cursor
- Motion
- on cursor · medium · motion · low cost
- Tags
- motion, useSpring
- Licence
- motion / motion/react / motion-v are MIT. Motion+ (premium components, example source, AI Kit pro tools) is paid — one-time Personal licence or per-seat Business.
- Live demo
- motion.dev
- Docs
- motion.dev
Similar
Compare all 4 →- Conic gradient pointermotion/conic-gradient-pointerAn example of creating a dynamic conic gradient with motion values and pointer position.
- Motion presetsoc/motion-presetsdesign-infra's motion languages (still / quiet / lively / cinematic) as motion/react transitions, springs and variants (fadeUp, scaleIn, stagger, press, lift). Set PROJECT_MOTION to your DESIGN.md `motion:` so hand-written animations match the system.
- Add to basketmotion/add-to-basketProduct flies into the cart along an arc() path with a spring impact — e-commerce delight. Free example (motion is MIT); copy and adapt the source from the example page.