---
title: "Corridor Gallery"
description: "A hall lined with pictures on every side. Drag to walk through an exhibition."
url: https://gelatinui.com/components/corridor-gallery
markdown_url: https://gelatinui.com/components/corridor-gallery.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/corridor-gallery"
version: "2026-11-24"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Corridor Gallery

> A hall lined with pictures on every side. Drag to walk through an exhibition.

Page: https://gelatinui.com/components/corridor-gallery

## When to use it

Best for: An exhibition people walk through: walls, floor, and ceiling of pictures rush past.

- Use `cardScale` and `gap` for the card size and the space between cards.
- Use `finish` (`clean`, `smear`, `glass`, `melt`, `pixel`, `ripple`) for the surface of the bent cards.

## When not to use it

- For a curved wall to stand in front of, use [Concave Wall Gallery](https://gelatinui.com/components/concave-wall-gallery.md).
- For pictures that float in dark space, use [Starfield Gallery](https://gelatinui.com/components/starfield-gallery.md).

## Notes for agents

- Each item needs `id`, `src`, `alt`, `title`, `meta`, and `text`. The caption shows `title` and `meta` of the front card.
- The root is a flex column, and the stage fills the rest of it: give the root a height, or give the stage one.
- With no WebGL, or with `renderer="css"`, the cards draw flat in CSS 3D. A cross-origin picture needs CORS headers.
- The pictures load when the gallery comes near the view, and it stops off screen.
- `drift` moves the cards at rest. `drive` takes a Motion value in cards (scroll or time); then the hand no longer moves it, and a drag stays with the page.
- `budget` (default 60) is the number of cards; it rounds up to whole copies of `items`.

## Anatomy

```text
CorridorGallery
```

## API reference

### CorridorGallery

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `readonly Readonly` |  |  |
| `drive` | `MotionValue<number>` |  | Moves the look from a value, in cards: 1.5 is halfway from card 1 to card 2. Use it for scroll or time. The hand no longer moves the look, and a drag stays with the page. |
| `finishes` | `readonly Readonly` |  | The finishes `finish` may switch between. The shaders hold all of them, so a switch fades and never builds the program again. A look item that offers a choice passes its choices. |
| `budget` | `number` |  | The number of cards in the look. It rounds up to whole copies of the items. |
| `cardAspect` | `number` |  | Card width / card height. Default: the one the look was made for. |
| `drift` | `number` |  | Cards per second while nobody touches the gallery. |
| `renderer` | `"auto" \| "css"` |  | `css` forces flat cards, as a page with no WebGL gets. |
| `cardScale` | `number` | 0.94 | The size of the frames on the corridor walls. |
| `gap` | `number` | 0.1 | The space between the frames down the corridor. |
| `finish` | `"clean" \| "glass" \| "melt" \| "pixel" \| "ripple" \| "smear"` | "clean" | The surface of the cards in motion: streaks of color (smear), glass, melt, pixel blocks, or ripples. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| CorridorGallery | `corridor-gallery` |  |  |  |

## Usage

Pass the cards as `items`, then place the stage and the caption parts. Give the root a height.

```tsx title="corridor-prints.tsx"
import { CorridorGallery, CorridorGalleryCaption, CorridorGalleryMeta, CorridorGalleryNext, CorridorGalleryPrevious, CorridorGalleryStage, CorridorGalleryTitle } from "@/components/pro/effects/corridor-gallery";

const PRINTS = [
  { id: "still", title: "Still", meta: "Print 08 · 40 × 50 cm", text: "A lake with no wind at all.",
    src: "/example-assets/mountain-lake-4x5.webp", alt: "A calm mountain lake at dawn" },
  { id: "low-cloud", title: "Low Cloud", meta: "Print 09 · 40 × 50 cm", text: "Green tops over white fog.",
    src: "/example-assets/misty-hills-4x5.webp", alt: "Green hills over valleys of fog" },
  { id: "gold-hour", title: "Gold Hour", meta: "Print 10 · 50 × 70 cm", text: "The first warm minutes of the day.",
    src: "/example-assets/hills-sunrise-4x5.webp", alt: "Fields and hills at sunrise" },
  { id: "stone", title: "Stone", meta: "Print 11 · 30 × 40 cm", text: "Cold granite with a line of pines.",
    src: "/example-assets/granite-cliff-pines-4x5.webp", alt: "Pines on a granite cliff" },
];

export function PrintsGallery() {
  return (
    <CorridorGallery items={PRINTS} className="h-[560px]">
      <CorridorGalleryStage />
      <CorridorGalleryCaption className="px-4 pb-4">
        <div className="min-w-0">
          <CorridorGalleryTitle />
          <CorridorGalleryMeta />
        </div>
        <div className="flex shrink-0 gap-2">
          <CorridorGalleryPrevious />
          <CorridorGalleryNext />
        </div>
      </CorridorGalleryCaption>
    </CorridorGallery>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/corridor-gallery
```

It adds 47 registry items: 43 files, 8548 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@unpic/core`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Concave Wall Gallery](https://gelatinui.com/components/concave-wall-gallery.md)
- [Starfield Gallery](https://gelatinui.com/components/starfield-gallery.md)
- [Dome Gallery](https://gelatinui.com/components/dome-gallery.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus to the stage. The focus ring shows on the front card. |
| ← → | Moves to the card before or after. The arrows swap in a right-to-left page. |
| Home, End | Moves to the first or the last card. |

## Motion

| Part | Motion |
| --- | --- |
| Move | glide · Previous, Next, and the arrow keys move one card in about 0.46s; a far card takes up to 0.86s |
| Throw | glide · a drag release lands where the cards would be 320ms later, on the nearest card |
| Rest | progress · with `drift`, the cards move on their own, in cards a second; after a touch the drift waits 5s and eases back in |
