Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

35e446604e294008a2e0c1974ec3c267

Mouse Follower

0 stars1🌍 Public
WWilliam Couturiaux
Last edited Mar 31, 2021
Created on Mar 31, 2021

A React component renders a yellow circle that follows the mouse cursor within an SVG canvas. The circle’s position is updated via React state, driven by the SVG’s `onMouseMove` event handler, which captures `clientX` and `clientY` coordinates. The example demonstrates interactive SVG rendering with React hooks (`useState`, `useCallback`) and `ReactDOM.render`. The circle starts centered in the 960×500 viewport and moves responsively with the pointer.

AI-generated description

A program that follows your mouse with a circle.