StealThis .dev

Smooth Cursor

Custom cursor with a dot and ring that smoothly follow the actual cursor with a spring-like lag effect.

Open in Lab
css javascript vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Smooth Cursor

A custom smooth cursor with a dot and ring that gracefully follow the real cursor position with a spring/lerp delay. The default cursor is hidden, replaced by stylized custom elements.

How it works

  1. The default cursor is hidden via CSS cursor: none
  2. Two elements — a small dot and a larger ring — track the mouse position
  3. Linear interpolation (lerp) smooths the movement, with the dot following faster than the ring
  4. requestAnimationFrame updates positions every frame for buttery-smooth motion

Customization

  • dotSize / ringSize — dimensions of cursor elements
  • dotColor / ringColor — colors
  • dotSpeed / ringSpeed — lerp factor (0-1, higher = faster follow)
  • Scale/morph on hover over interactive elements

When to use it

  • Portfolio and agency websites
  • Creative landing pages
  • Art and design showcases
  • Interactive experiences