Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Qqtrfx
Last edited Jun 17, 2023
Created on Jun 17, 2023

A circle follows the mouse pointer inside a static SVG viewport. The circle updates its position through React state management on mouse movement events. The React `useState` hook stores the mouse coordinates, and the `onMouseMove` handler on the `<svg>` element updates them, causing the circle to re-render at the new location. The example uses ReactDOM to render the SVG, with no data source beyond the cursor’s clientX and clientY values.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes