design-infraGitHub
Report a problem or share feedback← Catalog

Follow pointer with spring

curatedfree

motion/follow-pointer-with-spring

An example of making an element follow the pointer with a spring using Motion for React's useSpring hook.

cursor — mediumrecipeRefinedPlayful
$pnpm add motion # then adapt the free source from https://motion.dev/examples/react-follow-pointer-with-spring

npm 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.
Follow pointer with spring preview
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