# Scroll Formation

> A pinned stage where scattered images drift into a tidy grid as you scroll, while the title fades back.

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

export default function ScrollFormationDemo() {
  return (
    <ScrollFormation
      label="The Halden kit"
      title="Everything in the box, in its place."
      images={[cameraViews[0], cup, cameraViews[1], beans, cameraViews[2], pour, cameraViews[3], cameraViews[4], cameraViews[5]]}
    />
  );
}
```

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

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

## Usage

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

```tsx
<ScrollFormation label="The kit" title="Everything in the box." images={images} />
```

Six to twelve images read best. The section is about two and a half screens tall while it pins.

## Accessibility

- The section is labelled and the images keep their alt text in reading order.
- Before scripts run, and under reduced motion, the title sits over an ordinary grid with no pinning.

## API Reference

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

Source: https://brandstudio.js.org/docs/components/scroll-formation/
