Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Track cursor

Public visualization

Track cursor

0 stars0🌍 Public
Wwobling1
Last edited Oct 26, 2022
Created on Oct 26, 2022

A circle tracks the cursor inside an SVG canvas, updating its position in real time as the mouse moves. The visualization uses React’s `useState` hook to store the cursor coordinates and an `onMouseMove` event handler to update them. The circle’s `cx` and `cy` attributes are bound to the state, causing the element to re-render with the new position. The example relies solely on React and SVG, with no external data or animation libraries.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed