Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Image Trail, animated React component

Move across the area and it deals out photos along your path: each lands with a small overshoot, tilted the way you were heading, carries a bit of your speed, then drops away under gravity, blurring as it fades. Turn on the magnetic effect and the pointer shoves the photos that are still lying there.

  • Free
  • Motion Effects
  • Hover
  • Spring

Trail

Magnetic, with a headline

Like Image Trail? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Image Trail stays free.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Move across the canvas.

Props

PropTypeDefaultWhat it does
imagesDEFAULT_TRAIL_IMAGESImages dealt out in turn: { src, alt? }. Defaults to six drawn postcards, so nothing is fetched.
spacing48Pointer travel in px between one image and the next.
duration1000How long each image stays, in ms, before it falls away.
imageSize112Width and height of each image in px.
cornerRadius14Corner radius of each image in px.
smoothness0.70–1. Higher lets each image glide in from the last one.
fadeInDuration / fadeOutDuration0.25 / 0.5Fade times in seconds.
fadeInBlur / fadeOutBlur0 / 6Blur in px on the way in and out.
magneticEffectfalseLet the pointer shove images that are already down.
magneticRadius / magneticStrength110 / 0.3Reach in px and strength (0–1) of the shove.
maxTrailImages16Most images on screen at once.
staticPreviewfalseLay out a fixed fan of images and ignore the pointer.
hint"Move across the canvas."Hint shown when there are no children. An empty string hides it.
autoplayfalseA ghost pointer draws loops across the area until someone moves over it.
children—Content drawn above the trail, e.g. a headline.
className—Classes for the root; set its size here (defaults to h-80 w-full).

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry

    Run this once per project. It writes the Nexus UI entry into components.json for you:

    npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"

    Type it exactly as shown. {name} is filled in by the CLI with the component you ask for, so you never replace it.

  1. 3

    Add the component

    Run this from your project root. It adds the component, the helpers it imports and its npm packages.

    npx shadcn@latest add @nexus-labs/image-trail
  2. 4

    Check what was added

    With a project made as in the Quick Start (a src/ folder), these files land in it:

    components/
    image-trail/
    image-trail.tsx
    index.ts
  3. 5

    Copying by hand? Skip the registry

    Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that cn() exists. Install the packages:

    npm install framer-motion

    Then show the source and create each file at the path it gives:

  4. 6

    Use it in a page

    Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:

    // src/app/page.tsx
    import { ImageTrail } from "@/components/image-trail";
    
    export default function Page() {
      return (
        <main>
          <ImageTrail />
        </main>
      );
    }

Like Image Trail? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Image Trail stays free.

About Image Trail

Image Trail spawns image thumbnails at cursor positions as the mouse moves across the page, creating a ribbon of imagery that follows cursor movement. Each image appears, scales up briefly, then fades out — building a transient trail behind the cursor. Images are Framer Motion elements with independent lifecycle animations. Use it on photography portfolio pages and image-rich landing pages as a dramatic visual effect that communicates the product's visual nature.

Good for

  • Photography portfolio heroes
  • Creative agency landing pages
  • Image product and gallery showcases
  • Interactive visual brand experiences

Image Trail questions

How do I use my own images?

Pass `images` as an array of `{ src, alt }`; they are used in order as the cursor moves. Anything you pass as `children` renders above the trail.

Which props control the trail?

`spacing` (default 40px) sets how far the cursor travels before a new image appears, `duration` (default 1000ms) how long each stays, and `imageSize`, `cornerRadius`, `fadeInBlur` and `fadeOutBlur` the look. They also work grouped as `trailSettings`, `appearance` and `animation`.

Does the cursor image trail work on mobile?

Yes, it listens to touch moves as well as the mouse. For users who prefer reduced motion, images appear and disappear with a short fade instead of the scale and blur animation.

How do I install it?

Run `npx shadcn@latest add @nexus-labs/image-trail`. Set `magneticEffect` to make trail images drift toward the cursor.