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.

Move your pointer here
Button
Button
Pass over these words

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.

More optionsFewer options

Shape

The outline of the follower.

The dot swells while the pointer is on a button.

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.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Portfolios
  • Agency sites
  • Interactive stories

Avoid on

  • Forms and tools
  • Reading pages