<mat-expansion-panel> in Angular Material
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.
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.
|<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.|