🌍 Public
Viewing a saved revision (read-only)
73b0089f070c411d8c4997d68f5fed91
Track cursor
A circle tracks the cursor inside an SVG canvas, updating its position in real time as the mouse moves. The visualization uses React’s `useState` hook to store the cursor coordinates and an `onMouseMove` event handler to update them. The circle’s `cx` and `cy` attributes are bound to the state, causing the element to re-render with the new position. The example relies solely on React and SVG, with no external data or animation libraries.
AI-generated descriptionA program that follows your mouse with a circle.