Custom Cursors
Custom cursors, magnetic interactions, trails and light effects.
Updated
What is a custom cursor effect, and when should you use one?
A custom cursor replaces or decorates the default pointer with an element that follows the mouse. It is built by hiding the native cursor with cursor: none, moving a positioned element on pointermove, and smoothing its motion with linear interpolation inside a requestAnimationFrame loop.
How to choose, performance and accessibility
- Custom cursors suit creative portfolios, agencies and product launches, where Magnetic Effect, Spotlight Reveal or Cursor Trail reinforce the brand; they add little to documentation or a checkout.
- Enable them only for devices with a precise pointer (
@media (pointer: fine)), keep the native text cursor in form fields, and respectprefers-reduced-motion. - Dot Follower is free with its full code; the other cursor effects on this page come with Premium.
View source code
<div class="custom-cursor cursor-dot" id="cursorDot"></div>
<div class="custom-cursor cursor-ring" id="cursorRing"></div>
<div class="cursor-zone" id="zone-dot">
Hover this area
<span class="info-text">Dot + ring cursor</span>
</div>.custom-cursor {
position: fixed;
pointer-events: none;
z-index: 9999;
display: none
}
.cursor-dot {
width: 8px;
height: 8px;
background: #6366f1;
border-radius: 50%
}
.cursor-ring {
width: 40px;
height: 40px;
border: 2px solid #6366f1;
border-radius: 50%;
transition: all .15s ease-out
}
.cursor-zone {
/* Ces variables venaient du design system du SITE : chez l'acheteur
elles n'existent pas, le fond disparaissait et les coins devenaient carres.
Scopees ici, elles cascadent sans polluer sa page. */
--bg-elevated: #1a1a24;
--radius-xl: 1rem;
--space-4: 1rem;
--text-muted: #8b8b93;
--text-secondary: #a1a1aa;
width: 100%;
height: 300px;
background: var(--bg-elevated);
border-radius: var(--radius-xl);
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
color: var(--text-secondary);
position: relative;
overflow: hidden;
}
.info-text {
position: absolute;
bottom: var(--space-4);
left: 50%;
transform: translateX(-50%);
font-size: 0.875rem;
color: var(--text-muted);
}
/* Le JS pose cette classe au survol d'une cible : sans regle, le curseur
natif restait visible par-dessus le curseur personnalise. */
.cursor-active {
cursor: none
}// Zone 1: Dot Follower
(function(){
const zoneDot = document.getElementById('zone-dot');
if (!zoneDot) return;
const cursorDot = document.getElementById('cursorDot');
const cursorRing = document.getElementById('cursorRing');
if (!cursorDot || !cursorRing) return;
let ringX = 0, ringY = 0;
let dotX = 0, dotY = 0;
zoneDot.addEventListener('mouseenter', () => {
zoneDot.classList.add('cursor-active');
cursorDot.style.display = 'block';
cursorRing.style.display = 'block';
});
zoneDot.addEventListener('mouseleave', () => {
zoneDot.classList.remove('cursor-active');
cursorDot.style.display = 'none';
cursorRing.style.display = 'none';
});
zoneDot.addEventListener('mousemove', (e) => {
dotX = e.clientX;
dotY = e.clientY;
cursorDot.style.left = dotX - 4 + 'px';
cursorDot.style.top = dotY - 4 + 'px';
});
function animateRing() {
ringX += (dotX - ringX) * 0.15;
ringY += (dotY - ringY) * 0.15;
cursorRing.style.left = ringX - 20 + 'px';
cursorRing.style.top = ringY - 20 + 'px';
requestAnimationFrame(animateRing);
}
animateRing();
})();Magnetic Elements
Elements move toward the cursor when it's nearby, with an elastic return.
Effect page →Cursor Spotlight
A light halo follows the cursor and reveals hidden content beneath a dark veil.
Effect page →Trail Particles
The cursor leaves a trail of luminous particles that fade with physics.
Effect page →Custom Cursor States
The cursor changes shape based on context: circle, diamond or dashed circle.
Effect page →Cursor Tilt Effect
The card tilts in 3D toward the cursor position with a dynamic light reflection.
Effect page →Elastic Cursor
A custom cursor that stretches in the direction of movement and bounces when stopping.
Effect page →Cursor Color Sampler
The cursor picks up the color of the hovered area and uses it as a luminous halo.
Effect page →Gravity Well Cursor
Particles near the cursor are pushed away, creating a distortion field around the pointer.
Effect page →Jack-o'-Lantern Cursor
Pumpkin-head cursor that scatters a trail of tiny pumpkins fading away quickly. Playful, immersive, 100% canvas (no external model or image).
💡 Perfect for: Halloween page/landing, seasonal giveaway, easter-egg, event header, children's page.
Séance Cursor
Interactive Ouija board: the planchette follows the cursor, nearby letters glow and a spectral thread traces the message. Eerie, immersive, perfect for Halloween.
💡 Perfect for: Halloween hero/landing, page easter-egg, interactive quiz/game, haunted 404 page, event teaser.