Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
CChristian Potdevin
Last edited Mar 21, 2021
Created on Mar 21, 2021

A React component renders an SVG circle that follows the mouse pointer across a 960×500 viewport. On every mouse move, the `onMouseMove` event handler updates the circle’s `cx` and `cy` coordinates via React’s `useState` and `useCallback` hooks. The circle starts centered and has a fixed radius of 30 pixels. The example demonstrates interactive SVG rendering with React, using only ReactDOM and no external data or visualization libraries.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes