Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
RRay Yang
Last edited May 29, 2022
Created on May 29, 2022

A yellow circle tracks the mouse cursor across an SVG canvas. The circle's position updates to follow the pointer as it moves. Built with React 16.9 and ReactDOM, the example uses the `useState` hook to store the mouse position and `useCallback` to handle the `onMouseMove` event on the SVG element. The circle is rendered with a variable `cx` and `cy` attribute, while the `clientX` and `clientY` coordinates from the event are used to update the state.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes