🌍 Public
Viewing a saved revision (read-only)
f688e19e12304bf19482e55fd70aaf4b
Mouse Follower
A yellow circle tracks the mouse cursor across an SVG canvas. The circle's position updates to follow the pointer as it moves. Built with React 16.9 and ReactDOM, the example uses the `useState` hook to store the mouse position and `useCallback` to handle the `onMouseMove` event on the SVG element. The circle is rendered with a variable `cx` and `cy` attribute, while the `clientX` and `clientY` coordinates from the event are used to update the state.
AI-generated descriptionA program that follows your mouse with a circle.