Mouse Follower
✓ Published0🌍 Public
This example shows an SVG circle that follows the mouse pointer as it moves over a 960×500 canvas. The circle is positioned by updating its `cx` and `cy` coordinates based on the `clientX` and `clientY` values from the mouse event. Built with React and ReactDOM, the app uses a `useState` hook to store the current pointer position and a `useCallback` handler to update it on each mouse movement. The rendering is done entirely with SVG, with a fixed circle radius of 30 pixels.
AI-generated descriptionA program that follows the mouse with a circle.
MIT Licensed