Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
SShmuel Leider
Last edited Jun 2, 2021
Created on Jun 2, 2021

A React application renders a single SVG circle that follows the mouse cursor across the full browser window. The component tracks pointer coordinates via React's `useState` and `useCallback` hooks, updating the circle's `cx` and `cy` attributes on every `onMouseMove` event. The viewport dimensions come from `window.innerWidth` and `window.innerHeight`, with the circle initially centered before the first mouse movement. The example demonstrates reactive state-driven SVG updates in a React 16.9 environment.

AI-generated description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes