<mat-button> 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 use it, we need to have angular installed in our project, after having it you can enter the below command and can download it.
ng add @angular/material
Types of Buttons in Angular material: Buttons present in angular material are called as <mat-button>. They are many types of mat-buttons available in angular material, they are:
The tag used for the buttons
|These are the normal default button|
|These buttons appear to be raised i.e., they have a kind of box-shadow|
|These buttons don’t have any background theme color.|
|These buttons are very flat i.e. they don’t have any kind of animation and only have a ripple effect.|
|These buttons are circular buttons.|
Mini Fab Buttons
|These buttons are also circular but compared to fab buttons they are small.|
- First, install the angular material using the above-mentioned command.
- After completing the installation, Import ‘MatButtonModule’ from ‘@angular/material/button’ in the app.module.ts file.
- Then using the above-mentioned tags in the table code all types of buttons.
- If we want to change the theme then we can change it by using the color property. In angular we have 3 themes, they are primary, accent, and warn.
- Once done with the above steps then serve or start the project.
Code Implementation: In this example, we will implement all types of <mat-button> in angular.