Accordion
Overview
Component a2-Accordion is a collection of panels displayed vertically.
Selector | Description |
---|---|
a2-accordion | Defines accordion component and its global configuration |
a2-accordion-group | Defines single accordion panel group |
a2-accordion
Inputs
Input | Type | Default | Description |
---|---|---|---|
closeOther | boolean | true | Defines if other panels should be closed when panel is opened |
ignoreDisabled | boolean | false | Defines if disabled panels should be skipped in navigation |
Outputs
Output | Type | Description |
---|---|---|
contentChange | EventEmitter of AccordionGroupState | Emits list of all available accordion groups every time when new group is added / removed from DOM |
change | EventEmitter of AccordionChangeEvent | When group is closed or opened emits its name and its current state |
navigation | EventEmitter of AccordionNavigationEvent | If closeOther is set to true emits names of current, next and previous opened groups. Can be used for wizard implementation. |
Methods
Method | Signature | Description |
---|---|---|
open | open(name: string): void | Allow to open given group by its name. |
close | close(name: string): void | Allow to close given group by its name. |
a2-accordion-group
Inputs
Input | Type | Default | Description |
---|---|---|---|
opened | boolean | false | Defines if given group should be opened |
disabled | boolean | false | Defines if given group should be disabled |
name | string | group-{id} | Defines custom group name |
header | string | N/A | Defines group header text |
type | string | default | Bootstrap panel type class name. One of the following "success", "info", "warning", "danger" |
Templates
Selector | Description |
---|---|
a2-Header | Allow to define custom group header. When present header input for group is ignored. |
a2-Footer | Allow to define custom group footer. |
Types
prev - previous group name
current - currently opened group name
next - name of next group to be opened
name - group name
opened - indicates if given group is opened
Represents initial state of accordion group.
name - group name
opened - indicates if given group is opened
disabled - indicates if given group is disabled
Example
HTML:
TypeScript: