Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follow

Public visualization

Mouse Follow

0 stars1🌍 Public
PPadoSensei
Last edited Mar 18, 2021
Created on Mar 18, 2021
Forked from React Starter

A circle inside an SVG follows the mouse's movement across the viewport in real time. The app initializes the circle at the center of a 960-by-500 coordinate space, then updates its position on every mousemove event. React’s `useState` and `useCallback` hooks manage the mouse coordinates, which are passed to the circle’s `cx` and `cy` attributes. The example renders using ReactDOM and React 16.13.1, with the SVG’s `onMouseMove` handler triggering the state update.

AI-generated description

React program to follow your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed