Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dev-haunt/llms.txt
Use this file to discover all available pages before exploring further.
CursorTrail hides the operating system cursor and replaces it with a custom interactive effect: a short trail of glowing pumpkin-orange dots that spring into position behind the mouse pointer and fade out within half a second. Each dot is animated independently by Framer Motion — scaling down and fading to transparent as it ages — so the trail has a comet-like taper. A secondary ghost-coloured ring tracks the very tip of the cursor for precision reference. The component is mounted at the top of Layout and covers the entire viewport, but it never blocks interaction thanks to pointer-events: none.
Hiding the default cursor
CursorTrail only works correctly when the browser cursor is hidden. This is handled globally in main.css:
cursor: pointer overrides restore visible feedback on interactive elements — important for accessibility, since users still need a pointer visual on hover even though the OS arrow cursor is gone.
Mouse tracking
Amousemove event listener is attached to window inside a useEffect:
.slice(-15). Older positions are pushed off the back as the mouse moves, giving the trail a consistent maximum length.
A second useEffect clears the trail array 500 ms after the mouse stops moving:
Trail dots
Each position in the state array is rendered as a<motion.div> wrapped in AnimatePresence:
- Colour —
bg-pumpkin(#ff7a1a) with a double-layerbox-shadowglow in the same orange - Shape — slightly teardrop-shaped via an asymmetric
border-radius(60% 60% 40% 40%on the vertical axis) - Fade —
opacity: 0.8 → 0over 0.5 s witheaseOut - Shrink —
scale: 1 → 0.2over the same duration, making older dots visually recede
Cursor ring
In addition to the trail, a static ghost-coloured ring is rendered at the most recent cursor position:border-ghost ring (#f4f1ea) provides precise cursor position feedback at the tip of the trail. Its transition-transform duration-75 gives it a very slight lag (75 ms) that visually separates it from the dots beneath.
Full component overview
Disabling CursorTrail
Customisation reference
| Property | Location | Default |
|---|---|---|
| Trail length | .slice(-15) | 15 dots |
| Dot colour | bg-pumpkin / boxShadow | #ff7a1a |
| Glow spread | boxShadow values | 10px inner, 20px outer |
| Fade duration | transition.duration | 0.5 s |
| Idle clear delay | setTimeout(..., 500) | 500 ms |
| Dot size | w-3 h-3 | 12×12 px |
| Ring colour | border-ghost | #f4f1ea |