TwitterGithub

Accordion

A vertically stacked set of interactive headings that each reveal a section of content.

Yes. It adheres to the WAI-ARIA design pattern.

Yes. It comes with default styles that match the other components' aesthetics.

Yes. It's animated by default, but you can disable it if you prefer.

Installation

npx nx g @spartan-ng/nx:ui accordion

Usage

import {
  BrnAccordionComponent,
  BrnAccordionContentComponent,
  BrnAccordionItemComponent,
  BrnAccordionTriggerComponent,
} from '@spartan-ng/ui-accordion-brain';
import {
  HlmAccordionContentDirective,
  HlmAccordionDirective,
  HlmAccordionIconComponent,
  HlmAccordionItemDirective,
  HlmAccordionTriggerDirective,
} from '@spartan-ng/ui-accordion-helm';
<brn-accordion hlm>
  <brn-accordion-item hlm>
    <brn-accordion-trigger hlm>
      <span>Is it accessible?</span>
      <hlm-accordion-icon />
    </brn-accordion-trigger>
    <brn-accordion-content hlm>
      Yes. It adheres to the WAI-ARIA design pattern.
    </brn-accordion-content>
  </brn-accordion-item>
</brn-accordion>
Alert