Skip to main content

angular material - How to use Accordion

app.component.html

<h2 style="padding-top:25px; padding-bottom:25px;">
  Angular Material - How to use Accordion
</h2>


<mat-accordion>
    
  <mat-expansion-panel hideToggle>
      <mat-expansion-panel-header>
        <mat-panel-title>Angular</mat-panel-title>
        <mat-panel-description>I am Angular.</mat-panel-description>
      </mat-expansion-panel-header>
      <p>This is Angular content.</p>
  </mat-expansion-panel>

  <mat-expansion-panel>
    <mat-expansion-panel-header>
      <mat-panel-title>React</mat-panel-title>
      <mat-panel-description>I am React.</mat-panel-description>
    </mat-expansion-panel-header>
    <p>This is React content.</p>
  </mat-expansion-panel>

  <mat-expansion-panel>
    <mat-expansion-panel-header>
      <mat-panel-title>Vue</mat-panel-title>
      <mat-panel-description>I am Vue.</mat-panel-description>
    </mat-expansion-panel-header>
    <p>This is Vue content.</p>
  </mat-expansion-panel>

</mat-accordion>
app.module.ts [import]

import {MatExpansionModule} from '@angular/material/expansion'
More Angular tutorials