Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
Vvangenned
Last edited Aug 8, 2022
Created on Aug 8, 2022

A React component renders an SVG circle that tracks the mouse cursor across a 960-by-500 viewport. The circle’s position updates in real time through React’s `useState` hook and an `onMouseMove` event handler on the `<svg>` element, which captures the cursor’s `clientX` and `clientY` coordinates. The example demonstrates interactive SVG rendering with React 16.9, using the `ReactDOM.render` method to mount the application, and relies on a production build from unpkg. The circle maintains a fixed radius of 30 pixels while following the pointer.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes