Accordion
Accessible disclosure list for dense related content sections.
- Selector
- ui-accordion
- Package
- @ngnova/ui/accordion
Import
import { UiAccordionComponent } from '@ngnova/ui/accordion';Usage & variants
Live examples use the public ui-accordion API, paired with the exact snippet a product team would paste into an Angular app.
Documentation topics
Accessible disclosure list for dense related content sections.
Production guidance
Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.
When to use
Use for FAQs, setup steps, or advanced settings where users usually need one section at a time.
Watch for
Disabled items remain visible but cannot be expanded.
Product recipes
Apply Accordion in distinct, copyable product scenarios—not just an isolated component state.
Multiple sections
Enable multiple when sections can stay open together.
1 2 3 4 5 6
<ui-accordion
multiple
[items]="items"
[active]="activeSections"
(activeChange)="activeSections = $event"
/>Frequently asked questions
Use single expansion when readers should focus on one detailed answer at a time.
1 2 3 4 5 6
<ui-accordion
ariaLabel="Billing questions"
[items]="billingQuestions"
[expandedIds]="['trial']"
(expandedIdsChange)="expandedQuestions.set($event)"
/>API Reference
Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.
Inputs
id generated string Base ARIA ID.
items [] readonly UiAccordionItem[] Disclosure items with value, title, content, and disabled state.
active [] readonly string[] Currently expanded item values.
multiple false boolean Allows more than one item to be open.
headingLevel 3 number ARIA heading level for every disclosure trigger, clamped from 1 through 6.
| Name | Type | Default | Description |
|---|---|---|---|
id | string | generated | Base ARIA ID. |
items | readonly UiAccordionItem[] | [] | Disclosure items with value, title, content, and disabled state. |
active | readonly string[] | [] | Currently expanded item values. |
multiple | boolean | false | Allows more than one item to be open. |
headingLevel | number | 3 | ARIA heading level for every disclosure trigger, clamped from 1 through 6. |
Outputs
activeChange OutputEmitterRef<readonly string[]> Emits the next active item values after user interaction.
| Name | Type | Description |
|---|---|---|
activeChange | OutputEmitterRef<readonly string[]> | Emits the next active item values after user interaction. |
Accessibility
- Each trigger exposes aria-expanded and aria-controls.
- Each panel is labelled by its trigger.
- Generated instance IDs prevent collisions and headingLevel fits triggers into the surrounding page outline.
Keyboard behavior
- Triggers are native buttons, so Enter and Space toggle the section.
Testing guidance
- Assert activeChange, single vs multiple mode, disabled items, unique IDs, heading levels, ARIA wiring, and harness interaction.