Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed