🌍 Public
Viewing a saved revision (read-only)
649ed1c4fcf24e4f890b20bb1b9c223d
Mouse Follower
A simple interactive visualization renders a single circle that follows the mouse cursor across an SVG canvas. The circle’s position updates in real time, tracking the user's pointer movement. The example uses React’s `useState` and `useCallback` to manage the mouse coordinates, and renders the circle via an SVG `<circle>` element with `cx` and `cy` attributes set from the current mouse position. The `onMouseMove` event handler on the SVG element captures the cursor's `clientX` and `clientY` values, which are then used to update the circle’s location.
AI-generated descriptionA program that follows your mouse with a circle.