# Image Trail

> Moving the mouse leaves a fading trail of images.

```tsx
import { ImageTrail } from '@brand-studio/ui';
import { beans, cup, pour } from '@/demos/assets';

export default function ImageTrailDemo() {
  return (
    <ImageTrail images={[cup, beans, pour]} className="demo-trail">
      <p style={{ margin: 0, fontSize: 'clamp(28px, 5vw, 56px)', fontWeight: 600, textAlign: 'center' }}>Move your mouse here.</p>
    </ImageTrail>
  );
}
```

## Installation

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme, ImageTrail } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Usage

```tsx
import { ImageTrail } from '@brand-studio/ui';
```

```tsx
<ImageTrail images={images}>
  <h2>Move your mouse here.</h2>
</ImageTrail>
```

## Accessibility

- Decorative only: trail images have empty alt text.
- Touch and reduced motion show only the content.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `images` | `ImageAsset[]` | – |
| `children?` | `React.ReactNode` | – |
| `spacing?` | `number` | `90` |
| `className?` | `string` | `''` |

Source: https://brandstudio.js.org/docs/components/image-trail/
