← All Components
<mth-accordion-item>
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
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>import '@methane-ui/ui/accordion-item';
import '@methane-ui/react';
export function Example() {
return <mth-accordion-item>Example</mth-accordion-item>;
}<script setup lang="ts">
import '@methane-ui/ui/accordion-item';
</script>
<template>
<mth-accordion-item>Example</mth-accordion-item>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/accordion-item';
import { MthAccordionItemDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthAccordionItemDirective],
template: `<mth-accordion-item>Example</mth-accordion-item>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/accordion-item';
import MthAccordionItem from '@methane-ui/svelte/MthAccordionItem.svelte';
</script>
<MthAccordionItem>Example</MthAccordionItem>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Unique item identifier within <mth-accordion>. |
heading | heading | string | "" | Plain-text trigger heading when not using the header slot. |
expanded | expanded | boolean | false | Whether the accordion panel is expanded. |
disabled | disabled | boolean | false | Disables toggling the accordion item. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-toggle | { value: string; expanded: boolean } | Cancelable event emitted when the trigger button is activated. |
mth-open | void | Cancelable event emitted before the panel opens. |
mth-after-open | void | Emitted after panel entry transition completes. |
mth-close | void | Cancelable event emitted before the panel closes. |
mth-after-close | void | Emitted after panel exit transition completes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | focus is on item trigger | toggles panel expansion |
both | focus is on item trigger | toggles panel expansion |
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 2 APG keyboard transitions across LTR/RTL. | mth-accordion-item.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(expanded), :state(disabled). | Conformance suite |