How to use matTooltip in Angular Material ? Last Updated : 08 Aug, 2024 Comments Improve Suggest changes Like Article Like Report Angular Material is a UI component library developed by 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 done it you can enter the below command and can download it. matTooltip is used when certain information is to be displayed when a user hovers on a button.Installation syntax:ng add @angular/materialApproach:First, install the angular material using the above-mentioned command.After completing the installation, Import ‘MatTooltipModule’ from ‘@angular/material/tooltip’ in the app.module.ts file.We need to use 'matTooltip' property to display the text we want to render.For showing the position we need to use the 'matTooltipPosition' property.We can also customize the position of the tooltip regarding where to display like using the following names as “above”, “below”, “left”, “right” etc.Once done with the above steps then serve or start the project.Project Structure: It will look like the following.Code Implementation:app.module.ts: JavaScript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatButtonModule } from '@angular/material/button'; @NgModule({ imports: [ BrowserModule, FormsModule, MatButtonModule, MatTooltipModule, BrowserAnimationsModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } app.component.html: HTML <br> <button mat-raised-button matTooltip= "Hover to display information on below." matTooltipPosition="below"> Hover to show information </button> <br><br><br><br><br> <button mat-raised-button matTooltip= "Hover to display information on right." matTooltipPosition="right"> Hover to show information </button> Output: Comment More infoAdvertise with us Next Article How to use matTooltip in Angular Material ? B bunnyram19 Follow Improve Article Tags : Web Technologies AngularJS Angular-material Similar Reads How to use mat-icon in angular? To include icons in your webpage, you can use mat-icon directive. Previously it was known as md-icon. It is better to use mat-icon as they serve SVG icons i.e. vector-based icons which are adaptable to any resolution and dimension, on the other hand, raster-based icons have a fixed pattern of dots w 2 min read How to use Angular Material in Angular 17? Angular Material is a comprehensive UI component library designed specifically for Angular applications. With its large collection of pre-built components and seamless integration with Angular, Angular Material simplifies the process of creating visually appealing and responsive user interfaces. In 2 min read mat-slide-toggle 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-sl 2 min read Angular Material Button Toggle Angular Material is a UI component library that is developed by Google so that Angular developers can develop modern applications in a structured and responsive way. By making use of this library, we can greatly increase the user experience of an end-user thereby gaining popularity for our applicati 4 min read MatSnackBar in Angular Material Angular Material is a UI component library developed by 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 done it you can enter the below command and can download it. MatSnackBar is 2 min read Like