Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Viewing a saved revision (read-only)

330006f77ebe4d138e70514e6ac7ebb3

Mouse follower

0 stars1🌍 Public
NNadir-Zenith
Last edited Aug 27, 2021
Created on Aug 27, 2021

A React component uses SVG to draw a circle that follows the mouse cursor across the full browser window. The circle’s position is tracked via the `onMouseMove` event handler, which updates React state with the cursor’s `clientX` and `clientY` coordinates. The SVG viewport matches the window’s inner width and height, and the circle is re-rendered with a fixed radius at the updated position. The example demonstrates declarative UI updates driven by user input, using React’s `useState` and `useCallback` hooks.

AI-generated description

Follows the mouse.