Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Mouse Follower - components

Public visualization

Viewing a saved revision (read-only)

9d7912b04eca4ec2b36b27be72608dd0

Fork of Mouse Follower - components

0 stars0🌍 Public
VVeerle
Last edited Jan 16, 2021
Created on Jan 16, 2021
Forked from Mouse Follower

A React application renders an SVG rectangle that tracks the user's mouse cursor across a 960-by-500 viewport. The `MouseFollower` component uses React's `useState` hook to store cursor coordinates, updating them via an `onMouseMove` event handler that calls `setMousePosition`. The SVG `<rect>` element repositions itself to the stored x and y coordinates. The code demonstrates state-based interaction without external libraries, relying solely on React's change detection to trigger re-renders.

AI-generated description

A program that follows your mouse with a circle.