Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
RRodrigo Zanco
Last edited May 4, 2021
Created on May 4, 2021

A single circle follows the mouse cursor within an SVG canvas. The example demonstrates the basic concept of tracking pointer movement and updating a visual element's position in response. It is built with React hooks, specifically `useState` to manage the circle's coordinates and `useCallback` to handle the `onMouseMove` event, rendering the circle with SVG attributes `cx` and `cy`. The scene is initialized with the circle centered, and no external data source is used.

AI-generated description

Seguir o mouse com um circulo.

MIT Licensed

Similar vizzes