Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
CCheng Tang
Last edited Oct 22, 2022
Created on Oct 22, 2022

A small circle tracks the mouse in real time across a full-window SVG canvas. The React component stores the pointer’s coordinates in state via `useState` and updates them on every `mousemove` event through `useCallback`. The circle’s `cx` and `cy` attributes are bound directly to the current mouse position, re-rendering on each movement. The example uses React 16.9 with `ReactDOM.render`, an SVG with inline event handling, and no external data source or animation library.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes