For Tailwind CSS v3 docs, click here.

Sleek Line Cursor

A reactive animated cursor trail with smooth wave-like motion, using spring physics and dynamic color waves.

API

Prop NameTypeDefaultDescription
classstring | string[]undefinedAdditional CSS classes for the canvas container element.
trailsnumber20Number of trailing lines rendered behind the cursor.
sizenumber50Number of spring-connected nodes per trail.
frictionnumber0.5Global friction applied to velocity.
dampeningnumber0.25Velocity damping applied between connected nodes.
tensionnumber0.98Reduces spring intensity across the tail, giving a fluid tapering motion.

💡 This component uses pointer-events-none and is fixed fullscreen by default. You can extend or override its styling via the class prop.

Install using CLI

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

Install Manually

SleekLineCursor.vue

Features

  • Spring-based animation: Trails follow the cursor using simulated spring physics and velocity propagation.
  • Color wave dynamics: Dynamic hue changes via sinusoidal wave functions, generating smooth color transitions.
  • Touch support: Works seamlessly with both mouse and touch inputs.
  • Lightweight and performant: Uses the native <canvas> API with no external dependencies.
  • Auto-resizing canvas: Resizes dynamically with window or orientation changes.
  • Custom styling: Easily styled using Tailwind or your own classes.

Credits