# Infinite moodboard

> An endless board of photos you can throw around with momentum, where a click grows any photo to fill the frame.

- Type: Component (special)
- Access: Arc Pro
- Page: https://uiarc.dev/components/infinite-moodboard
- Markdown: https://uiarc.dev/components/infinite-moodboard/markdown
- Source file: `registry/components/infinite-moodboard/infinite-moodboard.tsx`
- Dependencies: motion
- Keywords: special, gallery, gesture, new, infinite canvas, moodboard, pan, momentum, shared element transition, zoom, photos, parallax, drag

## When to use

- Inspiration boards, portfolios, and brand galleries meant to be explored.
- Showing a large visual collection in a small frame without pagination.

## When not to use

- Galleries that need an order or a count, like product images; use carousel or product-gallery.
- Pages where the wheel must always scroll the page; use photo-grid.

## Installation

Infinite moodboard is part of Arc Pro. The live preview is public; the source and install command need Pro.

### CLI with a Pro token

1. Create a token in your account and set it in the environment (or `.env.local`). Never commit it.

```bash
export ARC_PRO_TOKEN=arc_pro_...
```

2. Add the Pro registry to `components.json`:

```json
{
  "registries": {
    "@uiarc": "https://uiarc.dev/r/{name}.json",
    "@uiarc-pro": {
      "url": "https://uiarc.dev/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${ARC_PRO_TOKEN}"
      }
    }
  }
}
```

3. Install:

```bash
npx shadcn@latest add @uiarc-pro/infinite-moodboard
```

### Manual

Signed-in Pro members can copy the source from the Manual tab on the docs page.

- Plans: https://uiarc.dev/pricing
- Create a Pro token: https://uiarc.dev/account#pro-access
- Setup guide: https://uiarc.dev/docs/ai#pro-access

## Usage

```tsx
import { InfiniteMoodboard } from "@/components/arc/infinite-moodboard/infinite-moodboard";
import { photos } from "@/components/arc/lib/media";

export function Inspiration() {
  return <InfiniteMoodboard photos={[...photos]} label="Interiors and places" />;
}
```

## API reference

### InfiniteMoodboard

An endless board of photos. Drag with momentum or pan with a trackpad or wheel; each photo trails the motion by its own depth. Clicking a photo grows it out of its spot to fill the frame, and it flies back home on close.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `photos` (required) | `{ src: string; alt: string; width: number; height: number }[]` | – | Photos to scatter. They repeat in a pattern that never places a photo beside a copy of itself (with 20 or more photos). |
| `cellSize` | `number` | – | Grid cell size in px. Each cell holds one photo. Defaults to about a quarter of the frame width, between 130 and 240. |
| `onFocusChange` | `(photo: MoodboardPhoto \| null) => void` | – | Called when a photo opens or closes. |
| `label` | `string` | `"Moodboard"` | Accessible name for the board. |
| `aspectRatio` | `string` | `"16 / 11"` | CSS aspect ratio of the frame. |
| `className` | `string` | – | Extra class on the root. |
| `style` | `CSSProperties` | – | Inline styles on the root. |

## Keyboard interactions

| Keys | Action |
| --- | --- |
| Tab | Moves through the visible photos. A photo that takes focus off screen glides into view. |
| Arrow keys | Glides the board one cell in that direction. |
| Enter or Space | Opens the focused photo. |
| Escape | Closes the open photo and returns focus to its tile. |

## Accessibility

- The board is a named region with aria-roledescription="pannable board". Every tile is a button named with the photo's alt text.
- The open photo is a focused button with the alt text, labelled to close. Focus returns to the tile when it closes.
- Pointer focus draws no ring; keyboard focus shows Arc's shared focus ring.

## Motion

- Dragging tracks 1:1; release hands the last 90 ms of velocity to an exponential deceleration, like native scrolling.
- Each photo trails the camera by its own depth, so the board stretches slightly in motion and settles at rest.
- Opening grows the photo from its exact on-screen rect on a spring while the board blurs and recedes; closing flies it back to wherever its tile is now.
- Reduced motion removes momentum and the depth trail, and the open photo crossfades instead of flying.

## Responsive behavior

- The cell size follows the frame width, so phones show two to three photos per row.
- Touch: the frame owns drag gestures (touch-action: none). Tap opens a photo.

## Performance

- Only about 20 to 35 tiles are mounted at once. React re-renders only when the visible cell range changes; every frame writes transforms directly.
- Images fade in once decoded, and the loop stops when the board comes to rest.

## Notes for AI

- Pass intrinsic width and height for every photo so tiles keep the real aspect ratio and the open transition is a pure scale.
- The board captures the wheel inside it; give it a clear frame so people know where panning applies.
- Only cells near the viewport are mounted, so large photo sets are fine; the pattern repeats with period equal to the photo count.

## Related

- [Photo grid](https://uiarc.dev/components/photo-grid/markdown): Pinch through zoom levels and open any photo straight from its cell.
- [Lightbox gallery](https://uiarc.dev/components/lightbox-gallery/markdown): A masonry grid where photos zoom from their slot into a viewer you can swipe, pinch, and drag away.
- [Gravity well](https://uiarc.dev/components/gravity-well/markdown): A grid of tiles that bends toward the cursor like spacetime, with a click that sends a shockwave through it.

## Also in galleries

- [Product gallery](https://uiarc.dev/components/product-gallery/markdown): A product gallery with a hover magnifier, gliding thumbnails, and color and size variants that crossfade photos.
- [Cover flow](https://uiarc.dev/components/cover-flow/markdown): A depth rail of images you can throw, with soft grounded shadows and a quiet reflection.

## Guidance for AI tools

Infinite moodboard: An endless board of photos you can throw around with momentum, where a click grows any photo to fill the frame. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://uiarc.dev/llms.txt
