Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Mouse follower

0 stars1🌍 Public
PPetko4
Last edited Jul 31, 2022
Created on Jul 31, 2022

A single black circle follows the mouse cursor across a blank SVG canvas, updating its position in real time. The React app tracks pointer coordinates through an `onMouseMove` event handler and stores them in state with `useState`, then re-renders the circle using the `clientX` and `clientY` values. The example demonstrates a basic interactive pattern using React’s `useCallback` and ReactDOM, with SVG circle elements for rendering.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed