Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

061e01af45cf42a181aa9288cb9e6ca8

Mouse Follower

0 stars1🌍 Public
LLem Dulfo
Last edited Mar 8, 2021
Created on Mar 8, 2021

A full-screen SVG circle tracks the mouse in real time. It demonstrates React state management and event handling by updating the circle’s coordinates on every pointer movement. The application uses React’s `useState` and `useCallback` hooks within a functional component, rendering a single `<circle>` element inside an `<svg>` that covers the viewport. The `onMouseMove` event triggers a state update with the cursor’s `clientX` and `clientY` positions, causing React to re-render the circle at the new location.

AI-generated description

A program that follows your mouse.