← All Components
<mth-video-grid>
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
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>import '@methane-ui/rtc/video-grid';
import '@methane-ui/react';
export function Example() {
return <mth-video-grid layout="gallery" columns="0"></mth-video-grid>;
}<script setup lang="ts">
import '@methane-ui/rtc/video-grid';
</script>
<template>
<mth-video-grid layout="gallery" columns="0"></mth-video-grid>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/rtc/video-grid';
import { MthVideoGridDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthVideoGridDirective],
template: `<mth-video-grid layout="gallery" columns="0"></mth-video-grid>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/rtc/video-grid';
import MthVideoGrid from '@methane-ui/svelte/MthVideoGrid.svelte';
</script>
<MthVideoGrid layout="gallery" columns="0"></MthVideoGrid>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
participants | — | ReadonlyArray<unknown> | — | Array of participant media descriptors rendered in the grid. |
layout | layout | 'gallery' | 'speaker' | "gallery" | Active layout mode: gallery grid or spotlight speaker view. |
pinnedId | pinned-id | string | "" | ID of the pinned participant. |
activeSpeakerId | active-speaker-id | string | "" | ID of the currently speaking participant. |
columns | columns | number | 0 | Explicit grid column count (0 uses responsive auto-fit). |
label | label | string | "" | Accessible region label for the video grid. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | Focus is on a participant control in gallery or strip | Moves focus to the next participant control |
| ArrowLeft | ltr | Focus is on a participant control after the first item | Moves focus to the previous participant control |
| Enter | both | Focus is on a participant pin button | Toggles pin state and emits mth-pin-change |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 3 APG keyboard transitions across LTR/RTL. | mth-video-grid.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(speaker-layout), :state(gallery-layout), :state(empty). | Conformance suite |
| i18n | Routes 11 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |