04.20 · Micro-Interactions
Cursor Follower
A dot trails your pointer and flips the colors under it. Best for portfolios.
Hover it
Move your pointer over the box or tap in it (or Tab to it and use the arrow keys), or press Show me.
Inside, the cross is where the pointer is: each frame the dot closes part of the gap, in smaller and smaller steps. Move over the box, or press Show me.
No lag: the dot sits right on the pointer; Trails behind: it glides after it and eases in as it catches up. Move over either half, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Lag
A longer lag feels heavier and smoother.
Size
How big the dot is before it grows.
Keeps the dot visible on light and dark areas.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a cursor follower to [the page or section where it should appear]. Draw a small shape that follows the pointer with a slight delay: each frame, close a share of the gap that is exponential in the time since the last frame, so it follows at the same pace on every screen. Hide it when the pointer leaves. When the settings include them, let it flip the colors beneath it so it stays visible on light and dark areas alike, and let it grow over buttons and links. Move it with transforms only. Touch screens have no pointer, so hide it there or let it glide to where the visitor taps. If the visitor has reduced motion turned on, keep the normal cursor instead. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.