Skip to main content
100%

Circle Follower Mouse

✓ Published1🌍 Public
MMATTE-blz
Last edited Mar 26, 2021
Created on Mar 26, 2021
Forked from React Starter

A circle follows the mouse cursor across an SVG canvas. The visualization tracks pointer movement and updates the circle's position in real time. Built with React and SVG, it uses React's `useState` and `useCallback` hooks to manage the cursor coordinates. A `handleMouseMove` callback on the SVG element captures `event.clientX` and `event.clientY` values, which are then passed to the circle's `cx` and `cy` attributes. The circle starts centered in the 960×500 viewport and responds immediately to any mouse movement, creating a direct interactive feedback loop.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes