app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material - How to use custom label in Tab
</h2>
<mat-tab-group>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon style="margin-right:8px;" >
favorite
</mat-icon>
Favorites
</ng-template>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam tincidunt elit non molestie rutrum.
Donec blandit risus et sem iaculis aliquam.
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon style="margin-right:8px;" >
star
</mat-icon>
Ratings
</ng-template>
Cras feugiat pharetra dolor, ac euismod tellus maximus eu.
Etiam dignissim enim vel lacus molestie, in iaculis tellus
ultrices.
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon style="margin-right:8px;" >
shopping_cart
</mat-icon>
Shopping Cart
</ng-template>
Integer rhoncus tristique felis ut dignissim.
</mat-tab>
</mat-tab-group>
app.module.ts [import]
import { MatTabsModule } from '@angular/material/tabs'
import { MatIconModule } from '@angular/material/icon';
- angular material - How to use query Progress bar
- angular material - Percentage in determinate Progress bar
- angular - How to use clearInterval()
- angular material - Show custom color in Progress bar
- angular material - How to change Divider width
- angular material - How to change Divider thickness
- angular material - How to use indeterminate Progress spinner
- angular - How to use setTimeout()
- angular material - How to change Progress spinner color
- angular material - How to center Progress spinner
- angular material - How to use Card
- angular material - How to use Tabs
- angular material - How to slow Tabs content transition
- angular material - How to get Tabs selected index
- angular material - How to use Tabs selectedTabChange event