Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
AAD-W99
Last edited Sep 17, 2022
Created on Sep 17, 2022

A yellow circle follows the mouse cursor across a blank SVG canvas. The example demonstrates mouse tracking in React by updating the circle’s center coordinates on every pointer move. It uses React’s `useState` and `useCallback` hooks, with the `onMouseMove` event handler reading `clientX` and `clientY` from the event object to re-render the circle. The SVG is rendered via ReactDOM, and the initial circle position is centered within a 960×500 viewport.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes