Skip to content
SENVENLI UI

Image viewer

A full-screen dark lightbox with previous/next that cycle, arrow keys, a position caption and a filmstrip.
import { ImageViewer } from "@senvenli/react/display";

Examples

Open on a chosen photo

Each trigger opens the viewer on its own photo.

Guidelines

When to use it

  • Looking at photos full size.

Use something else when

  • Pictures page in place, inside the layout. Carousel
  • One picture is shown at its place in the page. Image

Accessibility

Keyboard

KeysWhat happens
Arrow left / rightPrevious or next photo, following the reading direction.
EscCloses the viewer.

Built in

  • Focus stays inside while open and returns to what opened it.

You provide

  • A title and alt text.

API reference

ImageViewer

image
ImageViewerImageDefault PlainImage

The image renderer (e.g. next/image); a plain <img> by default.

itemsRequired
CarouselItem[]

The photos in display order, each with its own alt text: the same shape as Carousel's items.

defaultIndex
numberDefault 0

The photo to open on; wrapped into range.

isOpen
booleanDefault true

Open by default, so rendering it opens it; or control it with onOpenChange.

onOpenChange
(isOpen: boolean) => void

Called with false on Esc, the close button or a press on the scrim.

titleRequired
string

Caption shown at the bottom and used as the accessible dialog title.

labels
{ close?: string; previous?: string; next?: string; position?: (index: number, total: number) => string; }

The viewer's words; the DS strings by default ("Close", "Previous image", "Next image", "Image 2 of 5").