Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Zzhangwbhi
Last edited Sep 6, 2021
Created on Sep 6, 2021

A circle follows the mouse cursor across an SVG canvas, updating its position in real-time in response to mouse movement. The example demonstrates state management in React, using the `useState` hook to store mouse coordinates and the `useCallback` hook to handle the `onMouseMove` event. The circle is rendered as an SVG `<circle>` element within a React component, with the width and height set to 960 and 500 pixels. The visualization uses React's declarative rendering to update the circle's `cx` and `cy` attributes as the mouse moves.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes