Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
Ssofia-martinovich
Last edited Mar 16, 2021
Created on Mar 16, 2021
Forked from Mouse Follower

A circle follows the mouse cursor across an SVG canvas. The example shows how React manages interactive state by tracking pointer coordinates. Using React hooks like `useState` and `useCallback`, the component updates the circle's `cx` and `cy` attributes on every `mousemove` event. The code renders a single `<circle>` element with a fixed radius of 30, initializing mouse position at (0,0) and updating it from `clientX` and `clientY` values.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes