Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Jjamesc4
Last edited Jan 10, 2022
Created on Jan 10, 2022

A React component renders an SVG circle that tracks the mouse position across a 960 by 500 viewport. The app uses the `useState` hook to store the current cursor coordinates and the `useCallback` hook to handle the `onMouseMove` event on the SVG element. As the pointer moves, the circle’s `cx` and `cy` attributes update reactively via `setMousePosition`, with a fixed radius of 30 pixels. The interaction is purely client-side, with no external data.

AI-generated description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes