Image Trail
Images that appear and fade along the pointer's path.
Overview
Image Trail drops images along the pointer's path as it moves across a section. Each image pops in where the pointer is, holds for a moment, and fades out, so a quick sweep leaves a short trail of work behind it. Use it in a portfolio or studio hero, behind a headline that stays readable on its own.
Three variants are available: scatter tilts and offsets each image a little, stack tilts them alternately and lets each one drift in the direction of travel, and fade keeps them upright and simply fades them.
The component reuses a small pool of images and animates them directly, so moving the pointer does not re-render your React tree.
Installation
Usage
import { ImageTrail } from "@/components/animated/image-trail"
<ImageTrail
images={["/work/01.jpg", "/work/02.jpg", "/work/03.jpg"]}
className="h-[28rem]"
>
<h1>Move your cursor</h1>
</ImageTrail>Images are used in order and repeated. Give the container a height; the trail is clipped to it.
Accessibility
Trail images are decorative. They have empty alt text and sit in a layer hidden from assistive technology, so screen readers only meet the children. Put anything people need, such as links to the work itself, in normal content.
With reduced motion enabled the trail is off and only the children show. Touch drags are ignored by default so touch scrolling keeps working; set touch to follow drags as well, which also stops the section from scrolling under a finger.