Cursor ImageTrail

mouse trail component with animated image effects on hover.

Hover me

Mouse move image 0Mouse move image 1Mouse move image 2Mouse move image 3Mouse move image 4Mouse move image 5Mouse move image 6Mouse move image 7Mouse move image 8Mouse move image 9Mouse move image 10Mouse move image 11Mouse move image 12Mouse move image 13Mouse move image 14Mouse move image 15

Installation

npx shadcn@latest add https://scrollx-ui.vercel.app/registry/cursorimagetrail.json 

Usage

import CursorImageTrail from "@/components/ui/cursorimagetrail";
<CursorImageTrail
      renderImageBuffer={50}
      rotationRange={25}
      animationStyle="dynamic" 
      images={Array.from({ length: 16 }, (_, i) => `/images/active/${i + 1}.jpg`)}
    >
      <section className="grid h-screen w-full place-content-center bg-white text-black dark:bg-black dark:text-neutral-200 antialiased">
        <p className="flex items-center gap-2 text-5xl font-extrabold uppercase tracking-wide transition-colors duration-500">
          <MousePointer className="w-10 h-10" />
          <span>Hover me</span>
        </p>
      </section>
    </CursorImageTrail>

API Reference

CursorImageTrail

The CursorImageTrail component creates an interactive mouse trail effect with animated images. It tracks mouse movement and renders images along the cursor path with configurable animation styles.

Props

PropertyTypeDefaultDescription
childrenReactNoderequired
Trigger content for the image trail on hover.
imagesstring[]required
Array of image URLs used in the trail.
renderImageBuffernumberrequired
Minimum pixel distance between image renders.
rotationRangenumberrequired
Maximum rotation (in degrees) for trail images.
animationStyle"dynamic" | "minimal""dynamic"
Controls animation complexity of the trail.

Built withby Ahdeetai.