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

<mth-accordion-item>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Disclosure section inside <mth-accordion> with same-root button[aria-expanded][aria-controls] and role="region" panel animated via MotionController.

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-item> (@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.
Ready · interact with <mth-accordion-item>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

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

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Unique item identifier within <mth-accordion>.
headingheadingstring""Plain-text trigger heading when not using the header slot.
expandedexpandedbooleanfalseWhether the accordion panel is expanded.
disableddisabledbooleanfalseDisables toggling the accordion item.

Events

EventDetail TypeDescription
mth-toggle{ value: string; expanded: boolean }Cancelable event emitted when the trigger button is activated.
mth-openvoidCancelable event emitted before the panel opens.
mth-after-openvoidEmitted after panel entry transition completes.
mth-closevoidCancelable event emitted before the panel closes.
mth-after-closevoidEmitted after panel exit transition completes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothfocus is on item triggertoggles panel expansion
bothfocus is on item triggertoggles panel expansion

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 2 APG keyboard transitions across LTR/RTL.mth-accordion-item.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(expanded), :state(disabled).Conformance suite