Skip to main content
100%

Fork of Mouse Follower

✓ Published0🌍 Public
AAdriana Rodriguez Sanabria
Last edited Oct 20, 2021
Created on Oct 20, 2021
Forked from Mouse Follower

This example shows a red circle that follows the mouse cursor inside an SVG canvas. The circle’s position is updated to the cursor’s client coordinates, with an initial position at the canvas center. The code uses React’s `useState` and `useCallback` hooks to manage and update the mouse position state, and ReactDOM renders the SVG element, which also includes a fixed red diagonal line, into the page. The SVG `onMouseMove` event handler triggers the position update.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes