Accordion
Overview
Features
- Create collapsible content sections with smooth animations
- Support for accordion mode (only one section open at a time)
- Customizable headers and content areas
- Built-in toggle buttons with click events
- Programmatic control over collapse state
- Smooth height and opacity transitions
Usage
axAccordionGroup
: The container for collapsible itemsaxAccordionItem
: Individual collapsible sectionsaxAccordionItemHeader
: The header section of a collapsible itemaxAccordionItemContent
: The collapsible content areaaxAccordionCloseButton
: A button to toggle the collapse state
Basic Example (HTML)
Accordion Mode (HTML)
Usage in Component (TypeScript)
Options
Directive Options
Demo
Section 1
Section 2
Best Practices
- Use the accordion mode when you want only one section open at a time
- Include clear visual indicators for the collapse/expand state
- Ensure headers are descriptive and clearly indicate the content they control
- Consider adding keyboard navigation support for accessibility
- Use appropriate transition durations for smooth animations