Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-gallery>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Composite media gallery pairing public mth-carousel and mth-lightbox tags with an RTL-aware roving-focus thumbnail strip.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Multi-Framework Playground & Snippets

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label for the gallery.
items—ReadonlyArray<unknown> | nullnullArray of GalleryItem media entries.
activeIndexactive-indexnumber0Zero-based index of the active gallery item.
lightboxOpenlightbox-openbooleanfalseControls whether the composed mth-lightbox overlay is open.
looploopbooleantrueAllows wrapping slide navigation in the composed carousel.
showThumbnailsshow-thumbnailsbooleantrueDisplays the thumbnail strip below the carousel.

Events

EventDetail TypeDescription
mth-change{ index: number; item: unknown | null }Fired when the active gallery item changes.
mth-lightbox-open{ index: number }Fired when a slide opens in the lightbox.
mth-lightbox-closeundefinedFired when the lightbox closes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeft / ArrowRightboththumbnail strip focusednavigates gallery thumbnails (RTL-aware)
Home / Endboththumbnail strip focusedmoves to first or last thumbnail
Enter / Spaceboththumbnail focusedselects corresponding gallery item

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 3 APG keyboard transitions across LTR/RTL.mth-gallery.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(lightbox-open).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test