# Image Transition

> A slideshow where each image dissolves into the next through drifting noise.

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

export default function ImageTransitionDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 720 }}>
      <ImageTransition label="The morning ritual" images={[beans, pour, cup]} />
    </div>
  );
}
```

## 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, ImageTransition } from '@brand-studio/ui';
import brand from './brand.json';

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

## Usage

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

```tsx
<ImageTransition label="The morning ritual" images={[beans, pour, cup]} />
```

The images keep their focal points through the dissolve. Serve them from the same origin, or with CORS headers, for WebGL to read them.

## Accessibility

- It is a labelled carousel. Previous and next buttons, the arrow keys and a sideways swipe change the image, and the count is announced.
- Each slide is a real picture with its alt text; hidden slides are hidden from screen readers.
- Without WebGL, and under reduced motion, images swap at once.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `images` | `ImageAsset[]` | – |
| `label?` | `string` | `'Gallery'` |
| `className?` | `string` | `''` |

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