Zoom Lightbox

A thumbnail that grows into a full-screen photo, pages sideways, and shrinks back into its tile when you drag it down, like Apple Photos.

  • Gallery
  • Gesture
  • Motion

Uses motion, clsx, tailwind-merge

Open in ChatGPTOpen in Claude

Recents

9 photos

Tap a photo. Drag it down to put it back.

Installation

Add the component on its own with the CLI, or copy the file in by hand.

The CLI writes components/ui/zoom-lightbox.tsx and installs motion, clsx and tailwind-merge. It needs the @keyframeui registry in components.json; add it once per project.

npx shadcn@latest add @keyframeui/zoom-lightbox

Examples

Finished sections built with Zoom Lightbox. Each one installs whole, with the component included.

Product Images

A storefront grid with portrait tiles and rounder corners. Captions carry the name, colorway and price.

Spring drop

New arrivals

6 styles

Ember Runner

Crimson

$140

Volt Trainer

Lime / Black

$120

Pastel Court

Lilac / Mint

$110

Coral Air

Sail / Coral

$150

Desert Low

Wheat

$130

Night Court

White / Black

$95

Case Study

Shots spread through an article, in different grids. The viewer pages through them in reading order and scrolls each one into view so it has a tile to land in.

Case study · Residential

The Hollow House

A 1960s bungalow opened up into one long room that follows the light from the street to the garden.

Client
Private
Year
2026
Scope
Interiors
The street side at dusk. The old garage is now the entrance.

The brief

Four small rooms, a corridor and a garage that hadn't held a car in decades. The owners wanted somewhere to read, somewhere to sit together, and to see the garden from the front door.

Reading corner in the old hallway.
The snug, with the original floorboards kept.

One room

Taking out two walls turned the corridor into the house's spine. Everything else hangs off it: the snug, the reading corner, and the long room that opens onto the garden.

One room from the front door to the garden.

Props

srcRequired

Typestring

ZoomLightboxItem: the full-size image shown in the viewer.

altRequired

Typestring

ZoomLightboxItem: describes the image, for both the tile and the viewer.

thumbnail

Typestring

ZoomLightboxItem: a smaller image for the tile, with the same aspect ratio. Defaults to src. The full image is preloaded on hover or focus.

caption

TypeReact.ReactNode

ZoomLightboxItem: shown under the photo in the viewer.

width / height

Typenumber

ZoomLightboxItem: intrinsic size of src. Lets the viewer size the photo before it loads. Without them the tile image's own ratio is used.

className

Typestring

ZoomLightboxItem: classes for the tile. Give it a size or aspect ratio; its corner radius carries into the zoom. ZoomLightbox also takes className and other div props for its wrapper.

imageClassName

Typestring

ZoomLightboxItem: classes for the tile's <img>.

overlayClassName

TypestringDefault"bg-background"

ZoomLightbox: classes for the backdrop behind an open photo. Items can sit anywhere inside ZoomLightbox; the viewer pages through them in document order.