# Depth Carousel (Pro)

> A carousel of photos that have real depth. Moving the pointer shifts near things against far ones, and changing slide flies the camera into the scene: the far parts give way to the next photo first while the foreground rushes past. Each photo ships with a small depth map. Drawn in WebGL, idle when still.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Blocks › Carousel |
| Live preview | https://uibrik.com/components/depth-carousel |
| Writes | 1 files into `components/uibrik/depth-carousel/`, plus `components/uibrik/_gl-carousel/gl-carousel.tsx` |
| Packages | `@tabler/icons-react`, `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 27, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/depth-carousel
```

No license yet? Tell the user Depth Carousel is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=depth-carousel#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { DepthCarousel } from "@/components/uibrik/depth-carousel/depth-carousel";

const slides = [
  { src: "/registry/depth-carousel/red-hallway.webp", depth: "/registry/depth-carousel/red-hallway-depth.webp", alt: "Corridor of vermilion torii gates over a stone path" },
  { src: "/registry/depth-carousel/seceda-peaks.webp", depth: "/registry/depth-carousel/seceda-peaks-depth.webp", alt: "Jagged Dolomite peaks above green meadows and pines" },
  // …3 more
];

<DepthCarousel
  ratio={0.625}
  maxWidth={800}
  rounding={24}
  parallax={50}
  push={55}
  duration={1.2}
  autoplay
  interval={5}
  controls
  slides={slides}
  defaultIndex={0}
  label="Gallery"
  // index={0}
  // onIndexChange={(index) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/depth-carousel.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `ratio` | `number` | `0.625` | Height against width. |
| `maxWidth` | `number` | `800` | Widest the carousel grows. It also stays short enough to fit the window. |
| `rounding` | `number` | `24` | Corner radius. |
| `parallax` | `number` | `50` | How far near and far shift apart under the pointer. |
| `push` | `number` | `55` | How far the camera flies into the scene on a change. 0 is a depth-ordered crossfade. |
| `duration` | `number` | `1.2` | Length of one transition. A drag scrubs it instead. |
| `autoplay` | `boolean` | `true` | Move on by itself. Holds on hover, focus and drag. |
| `interval` | `number` | `5` | Time between slides when autoplaying. |
| `controls` | `boolean` | `true` | Previous and next buttons under the carousel. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `slides` | `{ src: string; depth: string; alt: string }[]` | `5 sample photos` | The slides, in order, up to 32. depth is a greyscale map of the same framing, white near. Make one with any monocular depth model, e.g. Depth Anything V2. Photos on another origin need CORS headers to reach the GPU. |
| `index / onIndexChange` | `number / (index) => void` |  | Controlled current slide, from 0. |
| `defaultIndex` | `number` | `0` | Slide on mount when uncontrolled. |
| `label` | `string` | `"Gallery"` | Names the carousel for screen readers. |
| `className` | `string` |  | Classes for the wrapper. It fills its container's width. |

## Where it fits

- **Travel and real estate**: Landscapes and rooms gain depth from the photos you already have. Pairs with [Lens Carousel](https://uibrik.com/components/lens-carousel.md) (Pro).
- **Editorial heroes**: A calm hero photo that comes alive under the pointer.
- **Product scenes**: Lifestyle shots read as places you could step into.

## Same shelf: Carousel

- [Expanding Panels](https://uibrik.com/components/expanding-panels.md) (Pro): A row of image panels with one open and the rest narrow. Click one and it opens as the last closes, revealed with a clip-path so the picture is never squashed, while each image trails behind its panel, zooms in as it closes and catches up as it opens.
- [Fan Carousel](https://uibrik.com/components/fan-carousel.md) (Pro): Cards drift around an arch in an endless loop. Both sides dissolve into the background with a gradual blur and fade, and cards return at the other end without a seam.
- [Ink Bleed Carousel](https://uibrik.com/components/ink-bleed-carousel.md) (Pro): A carousel where the next photo soaks into the current one like ink through wet paper. A ragged tide comes in from the side you're heading to, a liquid swell along the front magnifies with an RGB split, the photos blend wet-in-wet, and a pastel glow gathers along the border and fades as the new photo settles. Drag to scrub the bleed. Drawn in WebGL, idle when still.
- [Lens Carousel](https://uibrik.com/components/lens-carousel.md) (Pro): A looping carousel whose edges behave like thick glass. Slides are pulled out towards the rim, swell taller, smear sideways and split into colour, then fold back mirrored at the very edge. Drawn in WebGL, idle when still.
- [Möbius Carousel](https://uibrik.com/components/mobius-carousel.md) (Pro): A 3D carousel whose ring twists like a Möbius strip: cards stand upright at the front, lean with the ribbon round the sides and lie flat across the back, showing their captions from behind. Drag to spin with momentum.
- [Particle Carousel](https://uibrik.com/components/particle-carousel.md) (Pro): Three photos across: the middle one whole and sharp, the ones either side clouds of glowing particles that still hold their picture. On a change the middle photo comes apart and streams into the side it leaves towards, while the other cloud is drawn in and settles into a sharp photo. Drag to scrub. Drawn in WebGL.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/depth-carousel/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
