app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material -
How to open and close Accordion all panels at once
</h2>
<div style="margin-bottom:25px;">
<button mat-raised-button color="primary"
(click)="accordion.openAll()">
Open All Panels
</button>
<button mat-raised-button color="accent"
(click)="accordion.closeAll()">
Close All Panels
</button>
</div>
<mat-accordion multi #accordion="matAccordion">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Python</mat-panel-title>
</mat-expansion-panel-header>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Integer vitae semper massa. Donec maximus, dui nec
dignissim blandit, ante odio varius ex,
nec volutpat erat justo ac magna.
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Django</mat-panel-title>
</mat-expansion-panel-header>
Vivamus ornare ipsum sit amet imperdiet laoreet.
Cras maximus elementum varius. Integer nisi tellus,
dapibus vitae neque non, tempor vehicula velit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>METEOR</mat-panel-title>
</mat-expansion-panel-header>
Sed vitae felis id velit luctus elementum ut quis nisl. Curabitur
consectetur, ipsum eget vulputate mattis, odio dolor hendrerit
massa, eget scelerisque justo tellus eu lectus.
</mat-expansion-panel>
</mat-accordion>
app.module.ts [import]
import {MatExpansionModule} from '@angular/material/expansion'
import { MatButtonModule } from '@angular/material/button'
- angular material - Action bar inside an Expansion Panel
- angular material - Expansion Panel opened & closed event
- angular material - Icon inside Expansion Panel header
- angular material - Show Accordion toggle icon on left
- angular material - Determine an Expansion Panel is opened or closed
- angular material - Determine an Expansion Panel is disabled or enabled
- angular material - How to toggle Expansion Panel expanded state
- angular material - Initially expand a panel in Accordion
- angular material - Expansion Panel expandedChange event
- angular material - How to change Expansion Panel header height
- angular material - How to use List
- angular material - List items separator
- angular material - How to generate List items from array
- angular material - How to use List dense layout mode
- angular material - How to use Navigation List