v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Lightbox

Inspect images with native modal focus and zoom controls.

Interactive preview

Image 1 of 3

Orbit geometric study

01 / Orbit study

Usage

import { Lightbox } from "@devvy-ui/react";

<Lightbox open={open} onOpenChange={setOpen} images={images} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
imagesGalleryImage[]requiredImage sources, descriptions and captions.
index / onIndexChangenumber / callbacklocal 0Controlled image selection.
Dialog visibility/focus propsDialogPropsrequiredModal behavior.

Accessibility & behavior

Platform Behavior & Guidelines

Composes Dialog, image navigation, zoom range and an overflow region for panning. Image errors retain alt text. Use returnFocusRef for pointer invokers that browsers do not focus.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add lightbox

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

Lightbox.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.