Skip to content

Accordion

<ax-accordion> is a container for collapsible items. Each <ax-accordion-item> projects a trigger ([axAccordionTrigger]) and content ([axAccordionContent]); the item supplies the button element and tracks open state via dependency injection.

import { AxAccordionComponent, AxAccordionItemComponent } from '@axisui-ng/data';
<ax-accordion type="single" collapsible [(value)]="open">
<ax-accordion-item value="a">
<span axAccordionTrigger>Shipping</span>
<div axAccordionContent>Ships in 2-3 business days.</div>
</ax-accordion-item>
<ax-accordion-item value="b">
<span axAccordionTrigger>Returns</span>
<div axAccordionContent>30-day return window.</div>
</ax-accordion-item>
</ax-accordion>
InputTypeDefaultNotes
type'single' | 'multiple''single'One open item vs many.
collapsiblebooleanfalseIn single, allow closing the open item. Ignored in multiple.
valuemodel<string | string[] | null>nullOpen item id(s) — string for single, string[] for multiple.
InputTypeDefaultNotes
valuestring (required)Unique id for this item.
disabledbooleanfalsePrevents toggling.
MarkerKindNotes
axAccordionTriggerAttribute slotInline content only — not a button; the item wraps it in a real <button>.
axAccordionContentAttribute slotPanel body inside the expandable region.

The accordion renders the trigger as a real <button> with aria-expanded and aria-controls wired to a role="region" content panel (aria-labelledby back to the trigger). Closed panels are inert. Project inline content (not a button) into [axAccordionTrigger].

Interactive examples live in Storybook under Data / Accordion. Run pnpm storybook to explore them.