1.1.0 • Published 6 years ago
bayan v1.1.0
About
An accordion component - a set of expanding sections. Only one section can be expanded at a time. When one section is expanded, all other sections are collapsed.
Getting started
npm install bayan@latest --save
import { AccordionModule } from 'bayan';
Add AccordionModule
to the imports array in your module.
Basic usage
<accordion>
<acc-section headerText="headerText" [sectionIndex]="index" [isExpanded]="isExpanded" (sectionExpanded)="onSectionExpanded($event)">
your HTML contents here
</acc-section>
<acc-section headerText="headerText" [sectionIndex]="index" [isExpanded]="isExpanded" (sectionExpanded)="onSectionExpanded($event)">
your HTML contents here
</acc-section>
<acc-section headerText="headerText" [sectionIndex]="index" [isExpanded]="isExpanded" (sectionExpanded)="onSectionExpanded($event)">
your HTML contents here
</acc-section>
</accordion>
Parameters for the <acc-section>
:
headerText
- text of the accordion section headersectionIndex
- this number will be passed to the sectionExpanded event handlersectionExpanded
- this event is emitted every time an accordion section is expanded. It's passed the sectionIndex.