Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
GGenpinZ
Last edited Mar 18, 2022
Created on Mar 18, 2022
Forked from Mouse Follower

This example uses React to render an SVG circle that follows the mouse cursor across the screen. The `index.js` file initializes a React state hook with the circle’s coordinates, then updates that state on every `onMouseMove` event triggered on the SVG element. The circle’s position is bound directly to the current mouse coordinates via the `cx` and `cy` attributes, with a fixed radius of 30 pixels. The visualization relies on React’s `useState` and `useCallback` hooks, along with `ReactDOM.render` to mount the component.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes