File tree Expand file tree Collapse file tree 4 files changed +25
-16
lines changed
components-examples/material/tabs/tab-group-align Expand file tree Collapse file tree 4 files changed +25
-16
lines changed Original file line number Diff line number Diff line change 1
1
.mat-tab-group {
2
2
margin-bottom : 48px ;
3
3
}
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 >
8
4
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 >
14
8
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 ">
16
15
< mat-tab label ="First "> Content 1</ mat-tab >
17
16
< mat-tab label ="Second "> Content 2</ mat-tab >
18
17
< mat-tab label ="Third "> Content 3</ mat-tab >
19
18
</ mat-tab-group >
19
+ <!-- #docregion align-end -->
Original file line number Diff line number Diff line change 1
1
import { Component } from '@angular/core' ;
2
+ import { MatButtonModule } from '@angular/material/button' ;
2
3
import { MatTabsModule } from '@angular/material/tabs' ;
3
4
4
5
/**
@@ -8,6 +9,8 @@ import {MatTabsModule} from '@angular/material/tabs';
8
9
selector : 'tab-group-align-example' ,
9
10
templateUrl : 'tab-group-align-example.html' ,
10
11
styleUrl : 'tab-group-align-example.css' ,
11
- imports : [ MatTabsModule ] ,
12
+ imports : [ MatTabsModule , MatButtonModule ] ,
12
13
} )
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.
70
70
71
71
### Label alignment
72
72
If 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.
74
74
75
75
<!-- example({"example": "tab-group-align",
76
76
"file": "tab-group-align-example.html",
You can’t perform that action at this time.
0 commit comments