ImageTrail

Moving the pointer across the area drops items along its path. Each pops in tilted, holds a moment, then shrinks away, and only a few live at once. Effects.

Open playground
Move your pointer across this area

About

ImageTrail is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ImageTrail } from "@ashutoshswamy/smoui" and set items, size, gap among its 5 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ImageTrail } from "@ashutoshswamy/smoui";

<ImageTrail height={320} items={photos.map((src) => <img src={src} alt="" />)}>
  <h2>Selected work</h2>
</ImageTrail>

Props 5

items

What gets dropped, in turn. Make each fill its box.

ReactNode[]
size

Width and height of each drop, px.

numberdefault 96
gap

Pointer travel between drops, px.

numberdefault 70
max

How many stay on screen at once.

numberdefault 7
children

Content under the trail.

ReactNode