Custom Cursor

Mood track «Pinball Spring» · Kevin MacLeod incompetech.com · licensed under Creative Commons BY 4.0
Example image of the style Custom Cursor
Preview built in HTML and CSS in this style

Cursore personalizzato · Cursor personalizado · Magnetic cursor · Cursore magnetico

The mouse pointer is replaced by a circle or dot that trails the movement with a slight delay. Over links and buttons it grows, changes colour or gets pulled in like a magnet.

Era
2016 – today
Use
Mainstream
Domain
Web / UIMotion
Mood
playfulboldimmersive
Explore

Live demo

View code
<main class="st">
  <h1>Muovi il<br><a href="#">cursore</a></h1>
  <p>passa sopra la parola evidenziata</p>
</main>
<div class="ring"></div><div class="dot"></div>
<script>
if(matchMedia('(prefers-reduced-motion: no-preference)').matches){
  const r=document.querySelector('.ring'),d=document.querySelector('.dot'),a=document.querySelector('a');
  document.body.classList.add('on');
  let x=innerWidth/2,y=innerHeight/2,rx=x,ry=y,idle=true,t=0;
  addEventListener('pointermove',e=>{idle=false;x=e.clientX;y=e.clientY});
  a.onpointerenter=()=>r.classList.add('big');a.onpointerleave=()=>r.classList.remove('big');
  (function f(){if(idle){t+=.025;x=innerWidth/2+Math.cos(t)*innerWidth*.28;y=innerHeight/2+Math.sin(t*2)*innerHeight*.22}
    rx+=(x-rx)*.14;ry+=(y-ry)*.14;
    d.style.transform=`translate(${x}px,${y}px)`;r.style.transform=`translate(${rx}px,${ry}px)`;requestAnimationFrame(f)})();
}
</script>
body{margin:0;background:#0E0E10;color:#F2F0EA;height:100vh;display:grid;place-items:center;overflow:hidden;font-family:Inter,sans-serif}
.st{text-align:center}
h1{font:800 clamp(40px,10vw,76px)/.95 Syne,sans-serif;margin:0;letter-spacing:-.02em}
a{color:#C6FF3D;text-decoration:none}
p{color:#7A7A80;font-size:14px;margin-top:18px;letter-spacing:.06em;text-transform:uppercase}
.ring,.dot{display:none;position:fixed;left:0;top:0;pointer-events:none;border-radius:50%}
body.on{cursor:none}
body.on .ring,body.on .dot{display:block}
.dot{width:8px;height:8px;margin:-4px 0 0 -4px;background:#FF5A36}
@media (prefers-reduced-motion:no-preference){
  .ring{width:44px;height:44px;margin:-22px 0 0 -22px;border:1.5px solid #F2F0EA;mix-blend-mode:difference;transition:width .35s cubic-bezier(.22,1,.36,1),height .35s cubic-bezier(.22,1,.36,1),margin .35s cubic-bezier(.22,1,.36,1),background .35s}
  .ring.big{width:120px;height:120px;margin:-60px 0 0 -60px;background:#F2F0EA}
}

Characteristics

  • Precise dot plus a lerping trailing ring
  • Grows over clickable elements
  • mix-blend-mode difference to invert colours
  • Magnetic buttons pulled toward the pointer
  • Mouse devices only

Palette

Click a swatch to copy it

Typography

Headings · Syne Custom Cursor

Body · Inter The mouse pointer is replaced by a circle or dot that trails the movement with a slight delay. Over links and buttons it grows, changes colour or gets pulled in like a magnet.

Motion

Easing
lerp 0.1–0.2 per frame (requestAnimationFrame)
Typical duration
continuo; transizioni di stato 200–400 ms
Techniques
requestAnimationFrame con interpolazione lineare, pointermove, mix-blend-mode difference, transform translate3d, GSAP quickTo, @media (hover: hover) and (pointer: fine)

Accessibility (reduced motion)

Keep the system cursor, or a custom one that tracks without lag, with no trails or magnetic pull.

Prompt for your agent

Copy and paste into your prompt to have an agent or image generator reproduce this style.

For web pages and UI

Design the web page or interface in this style: Custom Cursor (Cursore personalizzato, Cursor personalizado).
The mouse pointer is replaced by a circle or dot that trails the movement with a slight delay. Over links and buttons it grows, changes colour or gets pulled in like a magnet.
Characteristics: Precise dot plus a lerping trailing ring, Grows over clickable elements, mix-blend-mode difference to invert colours, Magnetic buttons pulled toward the pointer, Mouse devices only.
Palette: #0E0E10, #F2F0EA, #C6FF3D, #FF5A36, #7A7A80.
Typography: headings in Syne, body text in Inter (Google Fonts or equivalents).
Mood: playful, bold, immersive.
Motion: easing lerp 0.1–0.2 per frame (requestAnimationFrame), typical duration continuo; transizioni di stato 200–400 ms; techniques: requestAnimationFrame con interpolazione lineare, pointermove, mix-blend-mode difference, transform translate3d, GSAP quickTo, @media (hover: hover) and (pointer: fine).
With prefers-reduced-motion: Keep the system cursor, or a custom one that tracks without lag, with no trails or magnetic pull.
References: Siti premiati su Awwwards e FWA, GSAP quickTo, Cuberto Mouse Follower, MDN «cursor» e mix-blend-mode.

Relations

Influenced: Mouse TrailMouse TrailSimilar to: Micro-interactionsMicro-interactionsSimilar to: Physics DragPhysics DragSimilar to: Image Hover RevealImage Hover RevealSimilar to: Magnetic buttonMagnetic buttonSimilar to: Reactive dot gridReactive dot gridSimilar to: Spotlight cursorSpotlight cursorCustom Cursor
InfluencedSimilar toSee in the graph →

References

  • Siti premiati su Awwwards e FWA
  • GSAP quickTo
  • Cuberto Mouse Follower
  • MDN «cursor» e mix-blend-mode