Chromatic Cursor
A lightweight RGB cursor trail with independently styled color channels, a soft glowing head, and smooth canvas motion.
Installation#
pnpm dlx shadcn@latest add @davinciui/chromatic-cursorUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
trailLengthMaximum number of samples retained in the trail. | number | 40 |
splitDistancePerpendicular separation between RGB channels in pixels. | number | 5 |
fadeSpeedFade rate from 0.05 (long) to 1 (quick). | number | 0.25 |
sizeCursor head radius and stroke scale in pixels. | number | 9 |
tensionFollow responsiveness from 0.05 (soft) to 1 (tight). | number | 0.5 |
glowSoft additive glow around the trail. Disable on small thumbnails to save GPU time. | boolean | true |
redRed trail channel color. | string | "#FF4040" |
greenGreen trail channel color. | string | "#3DFF88" |
blueBlue trail channel color. | string | "#2E9BFF" |
themeBlending and core rendering scheme. Auto follows the site theme live. | "auto" | "light" | "dark" | "auto" |
qualityRendering detail and DPR cap. | "low" | "medium" | "high" | "high" |
hideSystemCursorHide the native cursor while the effect is active. | boolean | false |
containerRefOptionally constrain pointer tracking and rendering to a positioned host. | RefObject<HTMLElement> | — |
zIndexOverlay stacking order. | number | 9999 |
disabledTurn the effect off without unmounting it. | boolean | false |
classNameAdditional class name applied to the canvas. | string | — |
Accessibility#
It is a decorative canvas marked aria-hidden and pointer-events-none, so it adds nothing for assistive technology. The effect is mouse-only, and the optional custom cursor hides the native one only while active.
Motion#
A pointer-driven canvas trail eases toward the target using tension, with trailLength, fadeSpeed and splitDistance shaping persistence and channel separation. prefers-reduced-motion is checked on pointermove and clears the trail, effectively stopping the effect.
Known constraints#
- Skips initialization on coarse pointers, so touch devices keep the native cursor.
- When reduced motion is requested the canvas stays idle instead of animating.
- The canvas is decorative and should not be the only target for pointer interactions.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

