Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-drift/llms.txt
Use this file to discover all available pages before exploring further.
CursorGlow overlays a soft, circular turquoise bloom that trails the mouse cursor across the page. It uses Framer Motion useMotionValue and useSpring to animate position so the glow lags behind slightly and eases to a stop rather than jumping to the exact cursor coordinate — creating an organic, liquid feel that complements the aurora background. The component is entirely self-contained: it registers and cleans up its own event listeners, and it silently renders nothing on touch and stylus devices where a cursor glow would be meaningless.
Usage
PlaceCursorGlow once at the root of your application, alongside AuroraBackground. Both components are fixed and do not affect document flow.
CursorGlow checks window.matchMedia('(pointer: fine)') on mount. On touch screens and most stylus devices this media query returns false, so the component returns null immediately — no DOM node, no event listeners, no overhead.Props
CursorGlow accepts no props. All visual and physics values are internal constants.
How it works
Pointer-fine gate
Inside
useEffect, the component evaluates window.matchMedia('(pointer: fine)').matches. Only when this returns true does it set internal visible state to true and begin rendering the glow element.Motion values initialised off-screen
Two
useMotionValue instances, x and y, are created with an initial value of -100. This ensures the glow starts off the visible viewport so there is no flash on the first frame.Spring wrapping
Both motion values are passed through
useSpring with the configuration shown below. The spring outputs are bound to the element’s x and y style properties, providing the characteristic lag and ease-out as the cursor decelerates.Cursor tracking
A
mousemove listener on window calls x.set(clientX - 150) and y.set(clientY - 150). Subtracting 150 (half the 300 px element width/height) centres the circle precisely over the cursor hotspot.Spring configuration
| Parameter | Value | Effect |
|---|---|---|
damping | 25 | Controls resistance — lower = more oscillation |
stiffness | 200 | Controls speed — higher = snappier follow |
mass | 0.5 | Lighter mass amplifies stiffness; snappier than default |
Visual specification
| Property | Value |
|---|---|
| Size | 300 × 300 px |
| Shape | border-radius: 9999px (rounded-full) |
z-index | 50 (z-50) |
| Blend mode | mix-blend-screen |
| Background | radial-gradient(circle, rgba(45,212,191,0.15) 0%, rgba(45,212,191,0) 70%) |
| Pointer events | None (pointer-events-none) |
| Position | fixed top-0 left-0; translated by spring x / y |
Customisation
Changing the glow colour
Changing the glow colour
Edit the two
rgba(45,212,191,...) values in the inline background style. 45,212,191 is the RGB triplet for Aurora Drift’s turquoise (#2DD4BF). Swap in any RGB colour to shift the tint.Adjusting glow size
Adjusting glow size
Change the Tailwind classes
w-[300px] h-[300px] and update the mouse offset in both set calls from clientX - 150 to clientX - (newSize / 2). The gradient’s 70% stop can also be tightened to 40% for a more focused hotspot.Enabling on all pointer types
Enabling on all pointer types
Remove the
window.matchMedia('(pointer: fine)').matches guard and set visible to true unconditionally in useEffect if you want the glow on coarse-pointer (touch) devices too.