Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

<mat-expansion-panel> in Angular Material

  • Last Updated : 25 Feb, 2021

Angular Material is a UI component library that is developed by the Angular team to build design components for desktop and mobile web applications. In order to install it, we need to have angular installed in our project, once you have it you can enter the below command and can download it. <mat-expansion-panel> tag is a kind of dropdown which has collapse and expand functionalities.

Installation syntax:

ng add @angular/material


  • First, install the angular material using the above-mentioned command.
  • After completing the installation, Import ‘MatExpansionModule’ from ‘@angular/material/expansion’ in the app.module.ts file.
  • Then use <mat-accordion> tag as a parent tag for <mat-expansion-panel> tag.
  • Inside the <mat-accordion> tag we need to use <mat-expansion-panel> tag for every item.
  • For <mat-expansion-panel> tag we have many child tags which is been explained in the below table.
  • Once done with the above steps then serve or start the project.
Tag NameProperty
<mat-panel-title>It is used to display the title for the panel
<mat-panel-description>It is used to display the information regarding the panel.

Code Implementation:


import { CommonModule } from '@angular/common'
import { NgModule } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { MatExpansionModule } from '@angular/material'
import { AppComponent } from './example.component'
  declarations: [AppComponent], 
  exports: [AppComponent], 
  imports: [ 
export class AppModule {}


  <mat-expansion-panel >
        Click here to expand the panel      
<p>One stop portal to all Computer Science Subjects. </p>


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!