Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
DDaniel
Last edited Aug 10, 2023
Created on Aug 10, 2023
Forked from ReactBoilderPlate

This example shows a single circle that continuously tracks the user’s cursor within an SVG canvas, centering itself on the mouse’s current coordinates. The visualization relies on React’s `useState` and `useCallback` to capture `clientX` and `clientY` from the SVG’s `onMouseMove` event, updating the circle’s `cx` and `cy` attributes in real time. Initially positioned at the canvas center, the circle reacts instantly to any pointer movement, demonstrating a minimal interactive pattern with no external data source.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes