File tree Expand file tree Collapse file tree 4 files changed +24
-15
lines changed
components-examples/material/tabs/tab-group-align Expand file tree Collapse file tree 4 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 11.mat-tab-group {
22 margin-bottom : 48px ;
33}
4+
5+ .example-action-button {
6+ margin-top : 8px ;
7+ margin-bottom : 8px ;
8+ margin-right : 8px ;
9+ }
Original file line number Diff line number Diff line change 1- <!-- #docregion align-start -->
2- < mat-tab-group mat-stretch-tabs ="false " mat-align-tabs ="start ">
3- <!-- #enddocregion align-start -->
4- < mat-tab label ="First "> Content 1</ mat-tab >
5- < mat-tab label ="Second "> Content 2</ mat-tab >
6- < mat-tab label ="Third "> Content 3</ mat-tab >
7- </ mat-tab-group >
1+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'start' ">
2+ Start
3+ </ button >
84
9- < mat-tab-group mat-stretch-tabs ="false " mat-align-tabs ="center ">
10- < mat-tab label ="First "> Content 1</ mat-tab >
11- < mat-tab label ="Second "> Content 2</ mat-tab >
12- < mat-tab label ="Third "> Content 3</ mat-tab >
13- </ mat-tab-group >
5+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'center' ">
6+ Center
7+ </ button >
148
15- < mat-tab-group mat-stretch-tabs ="false " mat-align-tabs ="end ">
9+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'end' ">
10+ End
11+ </ button >
12+
13+ <!-- #docregion align-start -->
14+ < mat-tab-group mat-stretch-tabs ="false " [mat-align-tabs] ="alignment ">
1615 < mat-tab label ="First "> Content 1</ mat-tab >
1716 < mat-tab label ="Second "> Content 2</ mat-tab >
1817 < mat-tab label ="Third "> Content 3</ mat-tab >
1918</ mat-tab-group >
19+ <!-- #docregion align-end -->
Original file line number Diff line number Diff line change 11import { Component } from '@angular/core' ;
2+ import { MatButtonModule } from '@angular/material/button' ;
23import { MatTabsModule } from '@angular/material/tabs' ;
34
45/**
@@ -10,4 +11,6 @@ import {MatTabsModule} from '@angular/material/tabs';
1011 styleUrl : 'tab-group-align-example.css' ,
1112 imports : [ MatTabsModule ] ,
1213} )
13- export class TabGroupAlignExample { }
14+ export class TabGroupAlignExample {
15+ alignment : 'start' | 'center' | 'end' = 'start' ;
16+ }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ with the `matTabContent` attribute.
7070
7171### Label alignment
7272If you want to align the tab labels in the center or towards the end of the container, you can
73- do so using the ` [ mat-align-tabs] ` attribute.
73+ do so using the ` mat-align-tabs ` input or attribute.
7474
7575 <!-- example({"example": "tab-group-align",
7676 "file": "tab-group-align-example.html",
You can’t perform that action at this time.
0 commit comments