Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
SShanoy
Last edited Mar 13, 2022
Created on Mar 13, 2022

A React application renders a single SVG circle that follows the mouse cursor as it moves across the full-window viewport. The component uses the `useState` and `useCallback` hooks to track the cursor’s `clientX` and `clientY` coordinates, updating the circle’s `cx` and `cy` attributes on every `onMouseMove` event. The initial position is centered based on `window.innerWidth` and `window.innerHeight`. This simple interactive example demonstrates real-time state-driven SVG updates without any external data sources or animation libraries.

AI-generated description

Application that follows your mouse.

MIT Licensed

Similar vizzes