Skip to content
HomeCobalt

Lightbox

Shows pictures one at a time as large as the window allows, so a person can look at a photo properly, move through the others with it and come back to where they were.

Examples

A venue's photos on its booking page: each thumbnail opens the lightbox at that photo, with the arrows, the arrow keys or a swipe to move, and its caption under it.

The Fenwick Rooms

4 photos
In a messagePictures in a message open the lightbox on their own: press one, move through all five, and Escape gives the focus back to the picture you are on.
Ingrid Solberg
Ingrid Solberg

A few from this week, so you know what to pack.

Usage

Use it when

  • Photos a person wants to see whole: pictures in a message, a venue's or a listing's photos.

Use something else when

  • A document or a page to read beside the current one. Use Sheet instead.
  • Photos to pick from in a listing, such as a venue's cover. Use MediaTile instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/lightbox.json
import { Lightbox, LightboxTrigger } from "@/components/cobalt/ui/lightbox"