For Tailwind CSS v3 docs, click here.

Tailed Cursor

A smooth, colorful ribbon cursor trail rendered with WebGL using OGL, featuring dynamic shaders and customizable animation effects.

API

Prop NameTypeDefaultDescription
colorsstring[]["#ff9346", "#7cff67", "#ffee51", "#00d8ff"]Array of colors for each tail ribbon.
baseSpringnumber0.03Spring strength for tail movement responsiveness.
baseFrictionnumber0.9Friction factor slowing down the tail movement.
baseThicknessnumber30Base thickness of the tail ribbons.
offsetFactornumber0.05Horizontal offset factor between each ribbon line.
maxAgenumber500Maximum age for tail segments controlling their fade timing.
pointCountnumber50Number of points composing each ribbon tail.
speedMultipliernumber0.6Speed multiplier controlling the animation speed.
enableFadebooleanfalseEnables fading effect on tail edges.
enableShaderEffectbooleanfalseEnables dynamic shader wave effect on ribbons.
effectAmplitudenumber2Amplitude of the shader wave effect when enabled.
backgroundColornumber[][0, 0, 0, 0]RGBA background clear color for the WebGL canvas.

Installation

This component requires the OGL library for WebGL rendering.

npm
pnpm
bun
yarn
npm i ogl

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/tailed-cursor.json"

Install Manually

Copy and paste the following code:

TailedCursor.vue

Features

  • WebGL-powered tails: High-performance smooth trailing ribbons following the cursor.
  • Multi-color ribbons: Multiple colored tails with customizable colors and offsets.
  • Dynamic shaders: Optional shader-based waving effects and fade transitions.
  • Responsive and adaptive: Automatically resizes with container and supports touch input.
  • Customizable physics: Adjustable spring, friction, thickness, and speed for fine-tuned motion.
  • Lightweight integration: Minimal external dependencies, easy to integrate in Vue 3 apps.

Credits