Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
JJosephStalnaker
Last edited Jun 27, 2021
Created on Jun 27, 2021

This example renders a single black-outlined circle on a blank SVG canvas that follows the user’s mouse movements. The circle’s center updates to the current cursor coordinates, which are captured from the mouse event’s `clientX` and `clientY` properties. Built with React and ReactDOM, the application uses the `useState` hook to store the mouse position and an `onMouseMove` handler to trigger re-renders, drawing the circle with SVG elements.

AI-generated description

Follow mouse circle

Comments

Sign in to join the discussion.

MIT Licensed