Zephora UI

Overlay

Lightbox

Full-screen image viewer rendered in a portal with focus trap and Escape/backdrop dismiss. Navigates with arrow keys, buttons or swipe, offers zoom controls and an optional thumbnail strip.

Import

import { Lightbox } from "@zephora/react";

Examples

Gallery

Open a four-slide gallery from a button. Navigate with the arrow buttons, ArrowLeft/ArrowRight or a swipe; Escape or the backdrop closes it.

Thumbnail strip

`showThumbnails` renders a clickable strip below the image; the active thumbnail is highlighted. `defaultIndex` picks the starting slide.

Zoom disabled

`zoomable={false}` hides the zoom in/out controls for fixed-size artwork.

API

Lightbox props

PropTypeDefaultDescription
slides *LightboxSlide[]Images shown by the lightbox, in order.
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCalled whenever the lightbox requests an open state change.
indexnumberControlled active slide index.
defaultIndexnumber0Initial slide for uncontrolled usage.
onIndexChange(index: number) => voidFires whenever the active slide changes.
showThumbnailsbooleanfalseRenders a thumbnail strip below the image.
zoomablebooleantrueRenders zoom in/out controls.
classNamesPartial<Record<LightboxSlot, string>>Per-slot class overrides: "overlay" | "figure" | "image" | "caption" | "nav" | "navButton" | "closeButton" | "zoomControls" | "thumbnails" | "thumbnail". Appended after the module classes and also applied in unstyled mode.
unstyledbooleanfalseHeadless mode — skips Zephora styling.
…restOmit<HTMLAttributes<HTMLDivElement>, "children">Native div props are forwarded to the dialog panel.

LightboxSlide props

PropTypeDefaultDescription
src *stringImage source URL.
altstringAlternative text for the image (also used by its thumbnail).
titleReactNodeOptional caption rendered below the image.

Keyboard

KeyAction
ArrowRight / ArrowLeftGo to the next / previous slide.
EscapeCloses the lightbox (backdrop press also closes it).
Tab / Shift+TabCycles focus inside the viewer — focus is trapped while open.