🌍 Public
Viewing a saved revision (read-only)
6057743f61dd4d6584f86a2d97c65aaa
Mouse Follower
This example shows a circle that continuously follows the mouse cursor across a full-window SVG canvas. Built with React, it tracks the cursor’s `clientX` and `clientY` coordinates through an `onMouseMove` event handler, storing the position in state via `useState` and updating the circle’s `cx` and `cy` attributes accordingly. The `useCallback` hook optimizes the event handler, and the component renders a single SVG `<circle>` element without any data source.
AI-generated descriptionA Program that follows your mouse with a circle