# Infinite Canvas

> A wall of images you drag in any direction. It never runs out and glides after a flick.

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

export default function InfiniteCanvasDemo() {
  return (
    <div style={{ width: '100%' }}>
      <InfiniteCanvas label="Halden archive" images={[cup, cameraViews[0], beans, cameraViews[2], pour, cameraViews[3], cameraViews[1], cameraViews[4], cameraViews[5]]} />
    </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, InfiniteCanvas } from '@brand-studio/ui';
import brand from './brand.json';

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

## Usage

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

```tsx
<InfiniteCanvas label="Archive" images={images} />
```

## Accessibility

- The canvas is one focusable region; arrow keys pan it.
- Each image is named once. Copies that fill the wrap are hidden from screen readers.
- Before scripts run it is a plain scrolling grid. With reduced motion it stops when you let go.

## API Reference

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

Source: https://brandstudio.js.org/docs/components/infinite-canvas/
