Skip to main content
100%

Mouse follower

✓ Published1🌍 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.

MIT Licensed

Similar vizzes