Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Vvmonney
Last edited Sep 25, 2022
Created on Sep 25, 2022

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 description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes