Kinetic UI
Back to Introduction
General

Cursor Trail

A physics-based gradient orb that elastically tracks the mouse.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add cursor-trail
cursor-trail

Move Your Cursor

Notice the elastic gradient orb smoothly trailing behind your mouse movements.

Overview

The CursorTrail (or Blob Follower) is a heavily utilized effect in creative web design. It acts as an organic, ambient background aura that trails behind the user's cursor. Using framer-motion's spring physics, it lags slightly behind the actual cursor position, creating a sense of weight and elasticity.

Usage

import { CursorTrail } from "@/components/creative/cursor-trail"

export default function Layout({ children }) {
  return (
    <div className="relative min-h-screen bg-black overflow-hidden">
      <CursorTrail color="#ec4899" size={200} blur={80} />
      
      <main className="relative z-10">
        {children}
      </main>
    </div>
  )
}

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { CursorTrail } from "@/components/creative/cursor-trail";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { CursorTrail } from "@/components/creative/cursor-trail";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <CursorTrail
        color="example"
        size{10}
        blur{10}
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.