Skip to main content
Pricing

Lightbox

Pro

A full-screen overlay for viewing images, videos, or media at maximum resolution with a dark backdrop. Supports single-image view and gallery mode with arrow navigation between items. Includes a close button, optional caption text, thumbnail strip for gallery navigation, and pinch-to-zoom on touch devices. Traps focus and locks body scroll while open.

4 variants

image.jpg

Variants

VariantDescriptionWhen to use
SingleLightbox displaying a single image or media item with close button and optional caption.Use when a user clicks to enlarge a single image or media element.
GalleryLightbox with arrow navigation, item counter, and optional thumbnail strip for browsing a collection.Use for image galleries, product photos, or portfolio collections.

Usage Guidelines

Do

Provide a clearly visible close button and support Escape to dismiss.

Don't

Auto-play a gallery carousel — let the user control navigation.

Do

Show the current item index and total count in gallery mode — "3 of 12".

Don't

Remove the close button or rely solely on clicking the backdrop to dismiss.

Do

Preload adjacent images in gallery mode for smooth navigation.

Don't

Show the lightbox for non-media content — use a Modal instead.

Do

Support pinch-to-zoom on touch devices for image inspection.

Don't

Disable keyboard navigation in gallery mode.

Code

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Design Tokens

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Accessibility

  • Use role="dialog" with aria-modal="true" and a descriptive aria-label.
  • Focus must be trapped within the lightbox while open.
  • On open, move focus to the close button or the first interactive control.
  • On close, return focus to the element that triggered the lightbox.
  • In gallery mode, announce the current image position — "Image 3 of 12".
  • Navigation arrows must have descriptive aria-labels — "Next image", "Previous image".
  • Alt text from the original image should be available in the lightbox view.

Keyboard Interactions

EscapeCloses the lightbox and returns focus to the trigger.
ArrowRightNavigates to the next image in gallery mode.
ArrowLeftNavigates to the previous image in gallery mode.
HomeNavigates to the first image in gallery mode.
EndNavigates to the last image in gallery mode.
TabMoves focus between the close button, navigation arrows, and other controls.