Plugins
Trail Plugin
Add a trailing effect that follows the cursor across the screen.
The TrailPlugin adds a smooth trailing visual effect behind your cursor, similar to contrails behind airplanes. The trail automatically fades out after a short duration.
Demo
Features
- Smooth movement following your cursor
- Automatic fade-out rendering
- Highly customizable colors, lengths, and thickness
Installation
The TrailPlugin is included in the @cursor.js/pro package.
npm install @cursor.js/pro @cursor.js/coreBasic Usage
import { Cursor } from '@cursor.js/core';
import { TrailPlugin } from '@cursor.js/pro';
const cursor = new Cursor();
cursor.use(new TrailPlugin());Options
Prop
Type
Configuration
new TrailPlugin({
length: 15, // Number of trail particles
thickness: 3, // Thickness of the trail in pixels (default: 2)
color: '#ff0000', // Color of the trail (default: #000000)
fadeDuration: 800, // Trailing persistence duration in milliseconds (default: 500)
});