# Pinned Zoom

> A picture that starts as a framed card and grows to fill the screen as you scroll.

```tsx
import { PinnedZoom } from '@brand-studio/ui';
import { cup } from '@/demos/assets';

export default function PinnedZoomDemo() {
  return (
    <div style={{ width: '100%' }}>
      <PinnedZoom asset={cup} title="Make room for the first sip.">
        <p style={{ margin: 0 }}>The Huila lot, poured at ninety-four degrees.</p>
      </PinnedZoom>
    </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, PinnedZoom } from '@brand-studio/ui';
import brand from './brand.json';

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

## Usage

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

```tsx
<PinnedZoom asset={cup} title="Make room for the first sip.">
  <p>The Huila lot, poured at ninety-four degrees.</p>
</PinnedZoom>
```

The title fades as the picture grows; the children appear over the full picture at the end.

## Accessibility

- The picture keeps its alt text, and the title is a real heading.
- Before scripts run, and under reduced motion, it is the title over a full-width image.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `asset` | `ImageAsset` | – |
| `title?` | `React.ReactNode` | – |
| `children?` | `React.ReactNode` | – |
| `className?` | `string` | `''` |

Source: https://brandstudio.js.org/docs/components/pinned-zoom/
