Skip to main content
Public

Share visualization

Loading preview…

Mouse Follower

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Mouse Follower

1
MMinh Luong
Last edited Jan 8, 2022
Created on Jan 7, 2022

This example displays a single circle that follows the mouse cursor across the full browser window. The circle is rendered as an SVG element with its position updated on every mouse movement event. Built with React, the code uses the `useState` and `useCallback` hooks to manage and optimize the cursor position state, while `ReactDOM.render` mounts the component. The SVG viewport is set to the window’s dimensions, and the circle’s center coordinates are directly bound to the tracked mouse position.

AI-generated description

A Program that follows your mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed