Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
CChandré De Wet
Last edited Jul 9, 2021
Created on Jul 8, 2021

A yellow circle follows the mouse cursor across an SVG canvas, responding instantly to pointer movement. The example demonstrates React state management with the `useState` and `useCallback` hooks, where the cursor's `clientX` and `clientY` coordinates are stored in state and passed as the circle's `cx` and `cy` attributes. Built with React 16.9 and ReactDOM, the component renders a single SVG `<circle>` element that updates its position on every `onMouseMove` event, showcasing a minimal, real-time interactive visualization using only SVG rendering.

AI-generated description

A program that follows your mouth with a circle.

Also covers State of React.

MIT Licensed

Similar vizzes