Zazz Design Framework
Components

Lightbox

A media lightbox web component with an inline gallery, fullscreen dialog, and thumbs.

The lightbox pairs an inline <embla-carousel> gallery with a fullscreen <dialog> carousel and thumb strip, all wrapped in <media-lightbox>. Slides open the dialog via command="show-modal", so opening and closing still comes from HTML. The web component only coordinates state: it opens the dialog carousel at the gallery's current slide, focuses the viewport for keyboard navigation, and syncs the inline gallery to the last viewed slide when the dialog closes.

The elements use light DOM, so the .lightbox classes and data-embla-* attributes style and configure the same markup you author. The preview loads the required scripts automatically; open the JS tab to inspect the custom elements.

Default

Loading components…

API

MarkupWherePurpose
<media-lightbox class="lightbox">rootCoordinates the inline gallery and dialog carousel
<embla-carousel class="lightbox__stage">galleryInline carousel; owns drag, thumbs, and stage navigation
<dialog class="lightbox__dialog">rootFullscreen modal surface
<embla-carousel>dialogFullscreen carousel; initialized when the dialog opens
command="show-modal" / command="close"triggersOpens and closes the dialog through Invoker Commands
data-embla="viewport" / "container" / "slide" / "thumbs"childrenEmbla roles for stage, slides, and thumb carousel

Put Embla options (data-embla-loop, data-embla-classnames, etc.) on each <embla-carousel>.

On this page