Mouse Follower
✓ Published0🌍 Public
This example shows a single circle that follows the mouse cursor across the full browser window. The circle’s position updates in real time as the user moves the pointer over an SVG canvas. Built with React (version 16.9.0) and ReactDOM, the component uses the `useState` hook to store the mouse coordinates and the `useCallback` hook to handle `mousemove` events, retrieving `clientX` and `clientY` from the event object. The SVG is sized to `window.innerWidth` and `window.innerHeight`, with the circle’s `cx` and `cy` attributes bound to the current mouse position.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed