Skip to content
Browse docs and components

Lightbox

lightbox

A photo gallery whose thumbnails fly into a full-screen viewer and back again. Arrow keys, a thumbnail strip and swipe move between photos, and it is a Base UI dialog underneath, so focus is trapped and returns to the thumbnail you opened.

Responsive

Install

$npxshadcnadd@forme/lightbox

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Lightbox

A gallery whose thumbnails open into a full-screen viewer — and the photo itself flies from the grid into place, then flies back when you close it.

PropTypeDefaultDescription
images*readonly LightboxImage[]—
label*string—Accessible name for the gallery.
classNamestring—
thumbClassName(index: number) => string | undefined—Classes for each thumbnail button, e.g. a span for a featured image.