Black Friday: 30% off Pro

Get 30% off

Updated

Depth Carousel

Pro

Preview

Customize

Ratio0.625
Max width800px
Rounding24px
Parallax50
Push55
Duration1.2s
Interval5.0s

Installation

Pro

Depth Carousel is a Pro component

Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.

Install with a key

  1. Add the Pro registry to components.json:
    components.json
    {
      "registries": {
        "@uibrik-pro": {
          "url": "https://uibrik.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" }
        }
      }
    }
  2. Put your key in .env.local and add that file to .gitignore:
    .env.local
    UIBRIK_LICENSE=your-license-key
  3. Install it:
    Terminal
    npx shadcn@latest add @uibrik-pro/depth-carousel

Usage

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) => {}}/>

Where to use Depth Carousel

  • Travel and real estate

    Landscapes and rooms gain depth from the photos you already have.

    Pairs with Lens Carousel

  • Editorial heroes

    A calm hero photo that comes alive under the pointer.

  • Product scenes

    Lifestyle shots read as places you could step into.

Props

DepthCarousel
ratio
Type number
0.625
Height against width.
maxWidth
Type number
800
Widest the carousel grows. It also stays short enough to fit the window.
rounding
Type number
24
Corner radius.
parallax
Type number
50
How far near and far shift apart under the pointer.
push
Type number
55
How far the camera flies into the scene on a change. 0 is a depth-ordered crossfade.
duration
Type number
1.2
Length of one transition. A drag scrubs it instead.
autoplay
Type boolean
true
Move on by itself. Holds on hover, focus and drag.
interval
Type number
5
Time between slides when autoplaying.
controls
Type boolean
true
Previous and next buttons under the carousel.
slides
Type { 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
Type number / (index) => void
–
Controlled current slide, from 0.
defaultIndex
Type number
0
Slide on mount when uncontrolled.
label
Type string
"Gallery"
Names the carousel for screen readers.
className
Type string
–
Classes for the wrapper. It fills its container's width.