Back to AIX Effects LibraryQA Verified · Synced
Interactive Components/<CursorTrail />·Intermediate

Canvas Cursor Ribbon Trail

Engineered with ResizeObserver Retina DPR capping (<=2x) and intelligent rAF hibernation when cursor rests idle.

Next.js 16+React 19TypeScriptTailwind CSSZero External Deps
Draw cursor trail smoothly
Canvas 2D Tapered Stream
Idle autoplay automatically halts offscreen
len: 22 · stroke: 6px

Sweep pointer or drag finger across canvas surface to paint trail stream.

Installation

Zero External Dependencies

Zero external npm packages needed.

Usage

import { CursorTrail } from '@/components/effects/library/interactive/CursorTrail'

<CursorTrail
  trailLength={22}
  lineWidth={6}
  trailStyle="ribbon"
  accentColor="#536dfe"
  className="h-72 rounded-2xl bg-[#080b14]"
>
  <div className="p-8 text-white">Di chuyển con trỏ chuột tại đây</div>
</CursorTrail>

Props & API Reference

4 props
PropTypeDefaultDescriptionEffect
trailStyle'ribbon' | 'dots''ribbon'Rendering mode for trail vertices (continuous ribbon vs sparks).Toggles geometric draw path.
trailLengthnumber22Maximum vertex points retained per trail.Adjusts tail persistence length.
lineWidthnumber6Maximum stroke width at pointer head.Scales trail thickness.
accentColorstring'#536dfe'Canvas stroke and particle fill hex color.Sets trail pigment.

More in Interactive Components

View All 36 →
R=145px · k=0.14Approach & Click

Magnetic Button

Spring-damped cursor pull pill button featuring decoupled inner text parallax and radial XOR glow.

View Details
Move pointer or tap cells to illuminate hairline grid
01
Pointer Tracking
02
Masked Grid
03
Touch Ready
04
Zero Packages
Beam 280px · Grid 28px

Cursor Spotlight

Radial light container uncovering masked hairline coordinates cleanly under pointer.

View Details
Select tabs across uneven label widths
active: overview · stiffness 400

Fluid Navigation Indicator

Dynamic width spring capsule gliding smoothly between navigation tabs via scoped layoutId.

View Details