Cursor Follower

A smooth spring-based cursor follower with customizable physics, velocity scaling, and custom child icons or badges.

Spring Tracked (stiffness: 450, damping: 32)

Interactive Follower Stage

Move your pointer across this page to experience fluid spring-damped momentum and velocity scaling.

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/cursor-follower

API Reference

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedCustom icon, text badge, or React element displayed inside the cursor follower.
sizenumber40Width and height of the cursor follower in pixels.
offsetXnumber0Horizontal offset from the cursor coordinates.
offsetYnumber0Vertical offset from the cursor coordinates.
stiffnessnumber450Spring stiffness controlling how rapidly the follower catches up to the cursor.
dampingnumber32Spring damping controlling the smoothness and friction of deceleration.
massnumber0.5Spring mass controlling inertia and physical weight.
scaleOnMovebooleantrueScales the cursor follower slightly while the pointer is in active motion.
hideOnLeavebooleantrueHides the cursor follower when the pointer leaves the browser window or viewport.
classNamestringundefinedOptional custom Tailwind CSS utility classes.