Lightbox @astryx-svelte/core v0.3.0 · Lightbox

Usage

A fullscreen overlay for viewing images and videos at full resolution. Supports single-item and gallery modes with prev/next navigation, optional zoom and pan for images, and native video controls.
ts
import { Lightbox } from '@astryx-svelte/core';

Best practices

GuidancePractices
DoAlways provide alt text for every image for screen reader accessibility.
DoUse gallery mode with onIndexChange for multi-image sets.
DoEnable hasZoom only when viewing high-resolution images that benefit from close inspection.
Don'tUse the lightbox for non-image content; it is specialized for images.
Don'tNest interactive content inside captions; keep them plain text.

Examples

Common configurations, variations, and states.
Lightbox — Gallery
A thumbnail grid that opens a fullscreen gallery. Clicking any thumbnail opens the lightbox at that index. Prev/next navigation lets users browse all images without closing.
Lightbox — Video
Opens a video in the lightbox. Native browser controls are available. Zoom and pan are disabled for video items.
Lightbox — Zoom
A lightbox with zoom and pan enabled. Double-click the image to zoom in; drag to pan around. Double-click again or use the close button to exit.