Geometric Trail Cursor
A fullscreen procedural wireframe cursor history on pure black. Pointer movement extrudes twisting chains of outlined polygons along the exact cursor path. New shapes cycle through vivid hues before settling into a long-lived near-black geometric skeleton.
Installation#
pnpm dlx shadcn@latest add @davinciui/geometric-trail-cursorUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
activeColorStroke color for the newest geometry around the pointer. | string | "#22D3EE" |
colorCycleCycle newly emitted geometry through hues derived from activeColor. | boolean | true |
colorCycleSpeedHue rotation speed in degrees per second. | number | 40 |
ghostColorWireframe color the trail settles into after the active phase. | string | "#181818" |
backgroundColorCanvas clear color. | string | "#000000" |
minSizeMinimum polygon diameter in CSS pixels. | number | 16 |
maxSizeMaximum polygon diameter reached on fast flicks. | number | 150 |
spacingDistance in CSS pixels between emitted shapes along the path. | number | 16 |
densityMultiplier on the number of shapes emitted per distance travelled. | number | 1 |
velocityScaleHow strongly pointer speed inflates polygon size. | number | 1.4 |
rotationAmountPer-shape rotation step along a chain (radians) — the tunnel twist. | number | 0.15 |
activeDurationHow long newborn geometry stays vivid before fading into the dark wireframe. | number | 180 |
colorFadeDurationHow quickly vivid shapes settle into the dark wireframe. | number | 520 |
ghostDurationHow long aged geometry persists as a ghost, in milliseconds. | number | persistence-derived (~22000) |
persistence0–1 shortcut for trail longevity when ghostDuration is unset. | number | 0.9 |
strokeWidthBase stroke width in CSS pixels. | number | 1.5 |
glowSubtle shadowBlur applied only to the bright active head. 0 disables it. | number | 6 |
minSidesMinimum polygon side count. | number | 3 |
maxSidesMaximum polygon side count. | number | 6 |
maxShapesBuffer cap. Oldest shapes are dropped first. | number | 1200 |
enabledMaster switch — when false nothing is tracked or drawn. | boolean | true |
respectReducedMotionHonor prefers-reduced-motion by freezing trail generation. | boolean | true |
enableTouchGenerate trails from touch movement. | boolean | false |
zIndexOverlay stacking order. | number | 50 |
containerRefOptionally constrain pointer tracking and rendering to a positioned host. | RefObject<HTMLElement> | — |
classNameAdditional class name applied to the overlay wrapper. | string | — |
childrenContent layered above the effect. | ReactNode | — |
Accessibility#
The host and canvas are aria-hidden and pointer-events-none, so the trail is purely decorative and does not intercept clicks. Only pointer movement and pointer down create geometry; there is no focus or keyboard interaction and touch is opt-in via enableTouch.
Motion#
Polygons spawn along the pointer path, inflate with speed, settle rotation and scale, then fade from activeColor through hue cycling to ghostColor. activeDuration, colorFadeDuration, ghostDuration, persistence and colorCycleSpeed control timing. With respectReducedMotion enabled, a static background is painted once and no trail is generated.
Known constraints#
- Touch movement does not generate trails unless enableTouch is set.
- Reduced motion requests are honored by skipping the animated trail.
- The trail is decorative; it should not be the only feedback for a pointer action.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

