ImageLightbox
Controlled fullscreen image viewer with keyboard navigation plus zoom, pan, and pinch support for product and editorial galleries.
Best for
Import
import { ImageLightbox } from "@enadhq/enad-react-sdk/client/storefront"When to use it
Use ImageLightbox when product images or editorial photography need a fullscreen viewing experience with zoom, pan, and multi-image navigation. It is the standard viewer for PDP image galleries where visitors want to inspect details at full resolution.
The lightbox is controlled for visibility: the parent page manages open state and decides what triggers it, whether that is a dedicated button, a thumbnail click, or a product image tap.
Composition notes
ImageLightbox is a controlled fullscreen overlay:
imagesis an array ofImageAssetobjects withsrc, optionalalt, and optional stableidvalues.openandonOpenChangemanage visibility.activeIndexandonActiveIndexChangelet the parent decide which image is currently visible. Use them with thumbnail grids orProductImageto open directly to the clicked image and keep the inline gallery in sync.defaultActiveIndexis available when the parent wants the viewer to manage active-image state after the initial open.showThumbnailstoggles a thumbnail rail at the bottom of the viewer for quick navigation between images.viewTransitionsexposes a progressive-enhancement hook for shared-element continuity when the host app supports it.
Behavior and theming guidance
The viewer supports keyboard navigation with Left, Right, and Escape, touch swipe between images, and pinch-to-zoom on mobile. Zoom and pan are powered by react-zoom-pan-pinch.
The overlay covers the full viewport with a dark background. The thumbnail rail sits at the bottom and marks the current image clearly without overpowering the main media. Keep the image array manageable for smooth thumbnail rendering, and keep ImageAsset.id stable when you enable view transitions so the browser can treat the hero image and fullscreen image as the same asset.
Examples
Live examples you can edit directly in the sandbox.
Open from a primary action
A simple launch pattern for PDPs or editorial pages where the viewer opens from a dedicated control.
Launch from thumbnails with shared state
A natural PDP flow where the clicked thumbnail decides the fullscreen image and the parent keeps both gallery layers in sync.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| images | ImageAsset[] | — | No description yet. |
| open | boolean | — | No description yet. |
| onOpenChange | (open: boolean) => void | — | No description yet. |
| activeIndex | number | — | No description yet. |
| defaultActiveIndex | number | 0 | No description yet. |
| onActiveIndexChange | string | — | No description yet. |
| showThumbnails | boolean | true | No description yet. |
| viewTransitions | string | — | No description yet. |
| className | string | — | No description yet. |