Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
YYohR
Last edited Oct 27, 2021
Created on Oct 27, 2021

A blue circle tracks the mouse cursor across a 960 by 500 SVG canvas. The circle follows the pointer's exact coordinates, which are captured from the `clientX` and `clientY` properties of the mouse-move event. Built with React and ReactDOM, the example uses the `useState` hook to store the cursor position and the `useCallback` hook to handle the `onMouseMove` event on the SVG element. The rendered SVG outputs a single circle whose center coordinates update dynamically with each mouse movement.

AI-generated description
MIT Licensed

Similar vizzes