Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
WWilliam Couturiaux
Last edited Mar 31, 2021
Created on Mar 31, 2021

A React component renders a yellow circle that follows the mouse cursor within an SVG canvas. The circle’s position is updated via React state, driven by the SVG’s `onMouseMove` event handler, which captures `clientX` and `clientY` coordinates. The example demonstrates interactive SVG rendering with React hooks (`useState`, `useCallback`) and `ReactDOM.render`. The circle starts centered in the 960×500 viewport and moves responsively with the pointer.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes