Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
AAhmad Butt
Last edited Mar 3, 2021
Created on Mar 3, 2021

A single circle in an SVG viewport tracks the user's mouse in real time, following its position across the full screen. Built with React, the app uses the `useState` hook to store the current mouse coordinates and the `useCallback` hook to update them via the SVG `onMouseMove` event handler. The circle’s `cx` and `cy` attributes are bound directly to this state, causing a re-render on every pointer movement. The rendering approach is purely declarative, with the circle’s radius fixed at 30 pixels.

AI-generated description

Mouse follower

MIT Licensed

Similar vizzes