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

<mth-accordion>

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

Vertically stacked disclosure group coordinating <mth-accordion-item> expansion via SelectionController, SlotCollectionController, and RovingFocusController.

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-accordion> (@methane-ui/ui)
Compiled from W3C DTCG JSON into light-dark() and forced-colors rules.Streams zero-FOUC SSR templates across Astro, Next, Nuxt, SvelteKit, and Angular.Built-in keyboard navigation and screen-reader semantics with zero config.
Ready · interact with <mth-accordion>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/accordion"></script>
<mth-accordion collapsible>Example</mth-accordion>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
multiplemultiplebooleanfalseAllows multiple accordion items to be expanded simultaneously.
collapsiblecollapsiblebooleantrueAllows collapsing all items (when false, at least one item stays expanded).
valuevaluestring""Currently expanded item value (comma-separated when multiple is true).

Events

EventDetail TypeDescription
mth-change{ value: string }Fired when expanded item selection changes via user interaction.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothfocus is on an item triggermoves focus to next enabled item trigger
ArrowUpbothfocus is on an item triggermoves focus to previous enabled item trigger
Homebothfocus is on an item triggermoves focus to first enabled item trigger
Endbothfocus is on an item triggermoves focus to last enabled item trigger

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-accordion.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(multiple).Conformance suite