Image Trail

Use Image Trail for a decorative cursor effect inside a bounded editorial or portfolio area. Images appear only while a fine pointer moves, and the trail never intercepts links or buttons beneath it.

Preview

Reduce motion:Off
Tune:Off
Inspect
Move your cursor here

Installation

Basic usage

TypeScript
gallery-trail.tsx

Examples

Choose scale, fade, blur, rise, or tilt for the image treatment. Use maxImages and ignoreSelector to keep the effect bounded around interactive content.

Usage

API

PropertyTypeDefaultDescription
imagesstring[]requiredImage sources spawned in order as the pointer moves.
childrenReactNoderequiredThe content the effect is scoped to; the trail only spawns over this area.
classNamestring—Additional CSS classes for the container.
itemClassNamestring"w-40"Extra classes for each trail image (use for sizing, e.g. `"w-48"`).
thresholdnumber80Pointer distance in pixels travelled before the next image spawns.
maxImagesnumber8Maximum number of images alive at once.
lifetimenumber600How long an image stays before it animates out, in milliseconds.
variant"scale" | "fade" | "blur" | "rise" | "tilt""scale"Entrance and exit animation style.
ignoreSelectorstring"a, button, input, [data-image-trail-ignore]"CSS selector for elements that suppress the effect when hovered, keeping interactive UI unobstructed.
zIndexnumber10z-index of the trail layer.

Accessibility

The effect is decorative, ignores interactive elements, and runs only for a fine pointer. Reduced-motion preferences disable the trail.

Styling

Use className to define the effect area and place meaningful content in the normal document flow.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.

Related components