Here is what I have - Tabs with header
And here is what I want - Tabs with side buttons
This is my code -
.html -
<div class="container">
<button (click)="onPrev()">Prev</button>
<mat-tab-group [(selectedIndex)]="tabSelect">
<mat-tab label="First">
<mat-grid-list cols="3" gutterSize="16px">
<mat-grid-tile *ngFor="let x of [1,2,3]" class="mat-elevation-z2">
{{x}}
</mat-grid-tile>
</mat-grid-list>
</mat-tab>
<mat-tab label="Second">
<mat-grid-list cols="3" gutterSize="16px">
<mat-grid-tile *ngFor="let x of [4,5,6]" class="mat-elevation-z2">
{{x}}
</mat-grid-tile>
</mat-grid-list>
</mat-tab>
</mat-tab-group>
<button (click)="onNext()">Next</button>
</div>
.ts -
export class AppComponent {
tabSelect = 0;
onPrev() {
this.tabSelect = 0;
}
onNext() {
this.tabSelect = 1;
}
}
Queries -
- How do I hide the Tab Header? (when I set display:none, the tab body also disappears)
- How do I add side buttons inside mat-tab-group? (because when you do it normally, the buttons don't show up)
- Any other way that would give me the desired result!
I'm sure that the correct answer would help a lot of people. Thank You.