Skip to main content
100%

Track cursor

✓ Published0🌍 Public
Wwobling1
Last edited Oct 26, 2022
Created on Oct 26, 2022

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 description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes