Xzero UI
Pro library

Image trailPro

Moving the pointer leaves a curated trail of photos that pop in, lean, and fade away.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/image-trail
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/image-trail

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

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

const images = [
  { src: "/photos/tram.jpg", alt: "A yellow tram in Lisbon" },
  { src: "/photos/rooftops.jpg", alt: "Terracotta rooftops" },
  { src: "/photos/sea.jpg", alt: "The sea at dusk" },
];

export function Hero() {
  return (
    <ImageTrail images={images} style={{ height: 420 }}>
      <h1>Lisbon, in passing</h1>
    </ImageTrail>
  );
}

API reference

ImageTrail

An area that leaves a trail of photos behind the pointer. Photos pop in at the pointer, lean toward the direction of travel, drift on with its momentum, and fade.

PropTypeDefaultDescription
images (required){ src: string; alt?: string }[]–Photos shown in order along the trail. Pass small renditions; a photo is never shown larger than size.
childrenReactNode–Content laid over the trail, such as a headline. Links and buttons inside stay clickable.
spacingnumber90Pointer travel between photos, in px.
lifetimenumber700How long a photo stays before it fades, in ms.
sizenumber168Photo width in px.
aspectRationumber4 / 5Photo width divided by height.
maxTiltnumber10Largest lean in degrees at full pointer speed.
poolSizenumber14How many photos can be on screen at once.
introbooleanfalsePlays one short S-curve sweep of photos the first time the area scrolls into view, hinting at the effect. Skipped with reduced motion or once the pointer has moved in.
disabledbooleanfalseStops new photos and gives touch scrolling back to the page.
classNamestring–Extra class on the root. Give the root a height.
styleCSSProperties–Inline styles on the root.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in cursor

Guidance for AI tools

Image trail: Moving the pointer leaves a curated trail of photos that pop in, lean, and fade away. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components