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
| Prop | Type | Default | What it does |
|---|---|---|---|
| images | ImageTrailImage[] | DEFAULT_TRAIL_IMAGES | Images dealt out in turn: { src, alt? }. Defaults to six drawn postcards, so nothing is fetched. |
| spacing | number | 48 | Pointer travel in px between one image and the next. |
| duration | number | 1000 | How long each image stays, in ms, before it falls away. |
| imageSize | number | 112 | Width and height of each image in px. |
| cornerRadius | number | 14 | Corner radius of each image in px. |
| smoothness | number | 0.7 | 0–1. Higher lets each image glide in from the last one. |
| fadeInDuration / fadeOutDuration | number | 0.25 / 0.5 | Fade times in seconds. |
| fadeInBlur / fadeOutBlur | number | 0 / 6 | Blur in px on the way in and out. |
| magneticEffect | boolean | false | Let the pointer shove images that are already down. |
| magneticRadius / magneticStrength | number | 110 / 0.3 | Reach in px and strength (0–1) of the shove. |
| maxTrailImages | number | 16 | Most images on screen at once. |
| staticPreview | boolean | false | Lay out a fixed fan of images and ignore the pointer. |
| hint | string | "Move across the canvas." | Hint shown when there are no children. An empty string hides it. |
| autoplay | boolean | false | A ghost pointer draws loops across the area until someone moves over it. |
| children | ReactNode | — | Content drawn above the trail, e.g. a headline. |
| className | string | — | Classes for the root; set its size here (defaults to h-80 w-full). |
Add it to your project
- 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 createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor 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.
- 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
- 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.tsxindex.ts - 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:
- 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.