Image Trail

v1.0.0
FreeInteractivitypowered by @vectorvesper/motion

Images follow the pointer and fade behind it. Each one pops in, leans the way the pointer is moving and drifts off, and a fast stroke fills its gaps so the trail never breaks up. It reads the shared pointer sensor, reuses a fixed set of images and keeps fewer in the air on a slow device. Does nothing under reduced motion.

Image Trail

Installation

Step 1. Initialize ProjectOne-time setup

Run once in your project root to configure paths and dependencies:

npx vectorvesper init
Step 2. Add ComponentInstalls source & assets

Downloads and registers the component in your project:

npx vectorvesper add image-trail
Step 3. Required DependenciesAuto-installed with CLI

If installing manually or managing your package lock:

npm install @vectorvesper/motion
Packages:@vectorvesper/motion

Usage

A portfolio, studio or campaign hero where the work itself should come out to meet the visitor. Put your headline in as children; the trail passes over it.

Usage

import { ImageTrail } from "@/components/vv/image-trail";

const IMAGES = ["/work/01.webp", "/work/02.webp", "/work/03.webp", "/work/04.webp"];

export function Hero() {
  return (
    <ImageTrail images={IMAGES}>
      <h1>Selected work</h1>
    </ImageTrail>
  );
}

Do

  • Use small images cut to the same shape, around 400 px wide. Every move can bring a new one in, so a large file arrives late.
  • Give it eight or more images, so the same one doesn't come round too often.

Don't

  • Do not put it behind links or buttons people need to click; the trail passes over them. It never blocks the pointer, but it hides what is under it.
This component respects prefers-reduced-motion and provides a graceful fallback.

Props

Images follow the pointer and fade behind it. Each one pops in, leans the way the pointer is moving and drifts off, and a fast stroke fills its gaps so the trail stays even.

<ImageTrail />

The area the trail runs in, with your content laid under it. 100svh tall unless you size it.

PropTypeDefaultDescription
images*(string | { src: string; alt?: string })[]—Images the pointer leaves behind, used in order.
sizenumber180Width of each image in px on a wide area. It shrinks on a narrow one.
rationumber1.25Height over width. 1.25 is a 4:5 portrait.
spacingnumber80Pointer travel in px between images.
durationnumber1400How long each image stays, in ms.
maxnumber14Most images on screen at once. Fewer on a slow device.
radiusnumber6Corner radius in px.
mount"auto" | "eager""auto""auto" waits for a quiet moment to start; "eager" starts at once.
classNamestring—Sizes the area. Without a height it is 100svh tall.
styleReact.CSSProperties—Inline styles for the area. A height here wins over the default.
childrenReact.ReactNode—Content laid under the trail.
Under reduced motion no images appear. Your content shows as normal.
Runs on the Vector Vesper runtime: it reads the pointer from the shared sensor once a frame, stops when it is off screen, and keeps fewer images in the air on a slow device. The images are made once and reused, and each one animates on the compositor.
Client component. It renders your content on the server and starts the trail once it mounts, so it is safe in a server-rendered route.

Source

/**
 * Image Trail — Vector Vesper
 * https://vectorvesper.dev/components
 *
 * Copyright (c) 2026 Vector Vesper
 * Released under the MIT License. This notice must be retained in copies and
 * substantial portions of the file. https://vectorvesper.dev/license
 */
export { ImageTrail } from "./ImageTrail";
export type { ImageTrailProps, ImageTrailItem } from "./ImageTrail";
View on GitHubReport an issue