An accordion is a group of vertically stacked headings used to toggle the visibility of a section of content.
import { DaffAccordionComponent } from '@daffodil/design/accordion'
A wrapper for grouping accordion items.
@Component()
class DaffAccordionComponent {}
import { DaffAccordionItemComponent } from '@daffodil/design/accordion'
The wrapper for the title and content. It handles the expansion and collapse of the inner content when clicked.
All daff-accordion-item
s should be grouped inside the daff-accordion
component.
@Component()
class DaffAccordionItemComponent implements OnInit, DaffOpenable {
@Input() itemId: string = 'daff-accordion-item' + '-' + ++daffAccordionItemId
@Input() contentId: string = 'daff-accordion-item-content' + '-' + ++daffAccordionItemContentId
@Input() initiallyExpanded: boolean = false
@Input() disabled: boolean = false
reveal(): void
hide(): void
toggle(): void
}
void
Reveals the contents of the accordion item.
void
Hides the contents of the accordion item.
void
Toggles the visibility of the contents of the accordion item.
string
Default | 'daff-accordion-item' + '-' + ++daffAccordionItemId |
---|---|
Description | The unique id of an accordion item. Defaults to an autogenerated value. |
string
Default | 'daff-accordion-item-content' + '-' + ++daffAccordionItemContentId |
---|---|
Description | The unique id of an accordion item content. Defaults to an autogenerated value. |
boolean
Default | false |
---|---|
Description | Whether or not the item is initially opened by default. |
boolean
Default | false |
---|---|
Description | Disables an accordion item and prevents it from being expanded or collapsed. |
import { DaffAccordionItemTitleDirective } from '@daffodil/design/accordion'
Used to provide a high level overview of the content. It should be wrapped by a <daff-accordion-item>
.
@Directive()
class DaffAccordionItemTitleDirective {}
import { DaffAccordionModule } from '@daffodil/design/accordion'
@NgModule()
class DaffAccordionModule {}