Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

a127a48ee6744f8684261809c2e0a6b0

Mouse Follower

0 stars0🌍 Public
NNelson M
Last edited Nov 17, 2023
Created on Nov 17, 2023
Forked from Mouse Follower

A React application renders an SVG circle that follows the mouse cursor across a 960 by 500 pixel canvas. The circle's position updates in real-time via React state and the `onMouseMove` event handler, reading the cursor's `clientX` and `clientY` coordinates. When the mouse leaves the SVG area, the circle returns to its initial centered position through the `onMouseLeave` handler. React 16.9's `useState` and `useCallback` hooks manage the state updates efficiently.

AI-generated description

A program that follows your mouse with a circle.