app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
tabs = ["Angular","React","Vue"];
}
app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material - How to generate Tabs programmatically
</h2>
<h3>Selected Tab Index : {{tabGroup.selectedIndex}}</h3>
<mat-tab-group [selectedIndex]="0" #tabGroup>
<mat-tab
*ngFor="let tab of tabs"
[label]="tab">
Content of {{tab}}
</mat-tab>
</mat-tab-group>
app.module.ts [import]
import { MatTabsModule } from '@angular/material/tabs'
- angular material - How to change Progress spinner color
- angular material - How to center Progress spinner
- angular material - How to align Tabs
- angular material - How to disable Tabs content animation
- angular material - How to create & add Tab programmatically
- angular material - How to delete Tab programmatically
- angular material - How to show remove button on Tab label
- angular material - How to show Tab label bottom of content
- angular material - How to use vertical Slider
- angular material - How to change Slider width
- angular material - Tick interval auto in Slider
- angular material - Navigation list with button and icon
- angular material - How to use Action List
- angular material - Action list with button and icon
- angular material - How to use Selection List