← All Components
<mth-list>
Accessible vertical list coordinating <mth-list-item> children or .items data with RovingFocusController and SelectionController.
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-list>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/list"></script>
<mth-list selection-mode="none">Example</mth-list>import '@methane-ui/ui/list';
import '@methane-ui/react';
export function Example() {
return <mth-list selection-mode="none">Example</mth-list>;
}<script setup lang="ts">
import '@methane-ui/ui/list';
</script>
<template>
<mth-list selection-mode="none">Example</mth-list>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/list';
import { MthListDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthListDirective],
template: `<mth-list selection-mode="none">Example</mth-list>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/list';
import MthList from '@methane-ui/svelte/MthList.svelte';
</script>
<MthList selection-mode="none">Example</MthList>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
selectionMode | selection-mode | 'none' | 'single' | 'multiple' | "none" | Selection behavior (none, single, or multiple). |
value | value | string | "" | Selected item value in single-selection mode. |
values | — | ReadonlyArray<string> | — | Array of selected item values. |
items | — | ReadonlyArray<unknown> | null | null | Optional imperative item list when not using slotted <mth-list-item> children. |
dividers | dividers | boolean | false | Renders subtle hairline dividers between list items. |
dense | dense | boolean | false | Reduces vertical spacing for compact layouts. |
label | label | string | "" | Accessible label for the list container. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; values: ReadonlyArray<string> } | Emitted when item selection changes. |
mth-action | { value: string } | Emitted when a list item is clicked or activated with Enter/Space. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowDown | both | List item has focus | Moves focus to next enabled item |
| ArrowUp | both | List item has focus | Moves focus to previous enabled item |
| Home | both | List item has focus | Moves focus to first enabled item |
| End | both | List item has focus | Moves focus to last enabled item |
| Enter | both | List item has focus | Activates item and toggles/selects when selectionMode != none |
both | List item has focus | Activates item and toggles/selects when selectionMode != none |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none" with host role="list". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 6 APG keyboard transitions across LTR/RTL. | mth-list.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dividers), :state(dense), :state(selectable). | Conformance suite |
| i18n | Routes 2 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |