Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

bb92c38a7264439aa6e9edd43cc03d25

Mouse Follower

0 stars1🌍 Public
AAhmad Butt
Last edited Mar 3, 2021
Created on Mar 3, 2021

A single circle in an SVG viewport tracks the user's mouse in real time, following its position across the full screen. Built with React, the app uses the `useState` hook to store the current mouse coordinates and the `useCallback` hook to update them via the SVG `onMouseMove` event handler. The circle’s `cx` and `cy` attributes are bound directly to this state, causing a re-render on every pointer movement. The rendering approach is purely declarative, with the circle’s radius fixed at 30 pixels.

AI-generated description

Mouse follower