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

<mth-list>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

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

Interactive StageLive Custom Element · <mth-list> (@methane-ui/ui)
@methane-ui/tokens@methane-ui/css@methane-ui/ui
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
selectionModeselection-mode'none' | 'single' | 'multiple'"none"Selection behavior (none, single, or multiple).
valuevaluestring""Selected item value in single-selection mode.
values—ReadonlyArray<string>—Array of selected item values.
items—ReadonlyArray<unknown> | nullnullOptional imperative item list when not using slotted <mth-list-item> children.
dividersdividersbooleanfalseRenders subtle hairline dividers between list items.
densedensebooleanfalseReduces vertical spacing for compact layouts.
labellabelstring""Accessible label for the list container.

Events

EventDetail TypeDescription
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

KeyDirectionWhenExpected Behavior
ArrowDownbothList item has focusMoves focus to next enabled item
ArrowUpbothList item has focusMoves focus to previous enabled item
HomebothList item has focusMoves focus to first enabled item
EndbothList item has focusMoves focus to last enabled item
EnterbothList item has focusActivates item and toggles/selects when selectionMode != none
bothList item has focusActivates item and toggles/selects when selectionMode != none

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none" with host role="list".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 6 APG keyboard transitions across LTR/RTL.mth-list.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(dividers), :state(dense), :state(selectable).Conformance suite
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test