Mouse Follower
✓ Published1🌍 Public
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 descriptionA program that follows your mouse with a circle.
MIT Licensed