Components
Particle Trail
Particles that trail behind the cursor.
ProPro, coming soon.
Draw with your pointer
<ParticleTrail>
<Hero />
</ParticleTrail>Get notified
Particle Trail is a Pro effect. Join the waitlist and we'll email you when it's available.
Usage
Colourful sparks burst from the pointer as it moves, drift down and fade. It draws on a canvas, and the drawing stops while it's off-screen or the tab is hidden. Without canvas support, your content shows on its own.
import { ParticleTrail } from "@zjkm/pro/particle-trail";
export function Hero() {
return (
<ParticleTrail className="rounded-2xl bg-neutral-950 p-16">
<h1 className="text-white">Leave a trail</h1>
</ParticleTrail>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Content shown over the sparks. | |
colors | string[] | pink, violet, sky, yellow | Spark colours, picked at random. |
density | number | 3 | Sparks per pointer movement. |
className | string | Classes for the wrapper. |
With reduced motion, it draws one still frame and doesn't react to the pointer.