Depth Gallery

Depth Gallery

A scroll-scrubbed Z-flythrough — plates hang scattered in 3D space and the scrollbar is the dolly; far plates loom out of the fog, near ones sweep past the camera.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/depth-gallery.json

▸ Or install manually

  1. Install dependencies: pnpm add motion
  2. Copy the source from the Code tab above.
  3. Place it at components/mellow/depth-gallery.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
itemsReactNode[]One plane per item — the camera flies through them front to back.
spacingnumber420Z distance between planes in px.
scrollContainerRefRefObject<HTMLElement | null>Scrollable ancestor when embedded; defaults to the window.
hudbooleantrueShow the 01 / 05 progress HUD.
stiffnessnumber90Camera-scrub spring stiffness.
dampingnumber24Camera-scrub spring damping.
massnumber0.65Camera-scrub spring mass.
classNamestringAdditional CSS classes.