Logo
React Bytes
Menu

Cursor Trail

HOVER ME

Customize

Trail Text

Props

trailText
Typestring
Default"✦"
Characters or emojis that spawn as trail particles.
style
Type"fade" | "float" | "shrink" | "spin" | "scatter"
Default"fade"
Particle animation style.
color
Typestring
Default"#a889c7"
Fallback color for particles when colors array is not provided.
colors
Typestring[]
Defaultundefined
Array of colors cycled through particles. Overrides color when provided.
spacing
Typenumber
Default30
Minimum distance in px the cursor must travel before a new particle spawns.
minSize
Typenumber
Default20
Minimum font size (px) of spawned particles.
maxSize
Typenumber
Default48
Maximum font size (px) of spawned particles.
exitDuration
Typenumber
Default0.4
Duration in seconds for each particle fade-out animation.
removalInterval
Typenumber
Default30
Interval in ms between removing trail items when the cursor stops moving.
maxPoints
Typenumber
Default12
Maximum number of trail particles visible at once.
followMouseDirection
Typeboolean
Defaultfalse
When true, each particle rotates to match the direction the cursor is moving.
randomFloat
Typeboolean
Defaulttrue
When true, particles drift with a random floating offset after spawning.
className
Typestring
Default""
Extra classes forwarded to the wrapper element.
children
TypeReactNode
Defaultundefined
Content to wrap. The trail activates anywhere inside this area.

Crafted withbyMohammad Tasin