Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
JJoakim Warholm
Last edited Jun 16, 2021
Created on Jun 16, 2021

A single circle follows the mouse cursor within an SVG canvas. The circle’s position is updated via React state, triggered by an `onMouseMove` handler that tracks `clientX` and `clientY` coordinates. The example uses React 16.9 with hooks (`useState`, `useCallback`) and renders the SVG element with the circle’s `cx` and `cy` attributes bound to the current mouse position. The visualization demonstrates a simple interactive pattern with minimal code, relying solely on React’s state management and SVG rendering.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes