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

<mth-video-grid>

@methane-ui/rtc~7.9 KB brotli shell + lazy engine~2.0 KB shell · lazy engine chunk

Accessible WebRTC participant video grid with speaker/gallery layouts and roving focus.

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

Live Interactive Preview

Interactive StageLive Custom Element · <mth-video-grid> (@methane-ui/rtc)
Ready · interact with <mth-video-grid>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/rtc/video-grid"></script>
<mth-video-grid layout="gallery" columns="0"></mth-video-grid>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
participants—ReadonlyArray<unknown>—Array of participant media descriptors rendered in the grid.
layoutlayout'gallery' | 'speaker'"gallery"Active layout mode: gallery grid or spotlight speaker view.
pinnedIdpinned-idstring""ID of the pinned participant.
activeSpeakerIdactive-speaker-idstring""ID of the currently speaking participant.
columnscolumnsnumber0Explicit grid column count (0 uses responsive auto-fit).
labellabelstring""Accessible region label for the video grid.

Events

EventDetail TypeDescription
mth-pin-change{ pinnedId: string }Fired when a participant is pinned or unpinned.
mth-layout-change{ layout: 'gallery' | 'speaker' }Fired when the user switches between gallery and speaker layout.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrFocus is on a participant control in gallery or stripMoves focus to the next participant control
ArrowLeftltrFocus is on a participant control after the first itemMoves focus to the previous participant control
EnterbothFocus is on a participant pin buttonToggles pin state and emits mth-pin-change

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-video-grid.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(speaker-layout), :state(gallery-layout), :state(empty).Conformance suite
i18nRoutes 11 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test