Skip to content
Overlays & Tooltips

Lightbox

Full-screen image gallery with thumbnails and keyboard navigation.

Import

tsx
import { Lightbox } from "@cronus-ui/ui";
bash
npx cronus-ui add lightbox

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component LightboxDefault layout:inline style:lightbox {
  aria-label:"Image gallery"
  label "Image gallery"
  text "First image"
  text "Second image"
}

page "/audit/lightbox/default" type:custom {
  use LightboxDefault
}

API Reference

Generated from the component's exported types.

LightboxLabels

Skip LightboxLabels props table
PropTypeDefaultDescription
gallery*
string——
close*
string——
previous*
string——
next*
string——
viewImage*
(index: number) => string——
counter*
(current: number, total: number) => string——

LightboxProps

Extends HTMLAttributes<HTMLDivElement>

Skip LightboxProps props table
PropTypeDefaultDescription
images*
LightboxImage[]—The images to display in the gallery.
open
boolean—Controlled open state.
onOpenChange
(open: boolean) => void—Called when the open state should change.
defaultOpen
booleanfalseUncontrolled initial open state.
index
number—Controlled active image index.
onIndexChange
(index: number) => void—Called when the active index should change.
defaultIndex
number0Uncontrolled initial index.
labels
Partial<LightboxLabels>—Override default English strings.
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.