File tree Expand file tree Collapse file tree 5 files changed +24
-19
lines changed
components-examples/material/tabs/tab-group-align Expand file tree Collapse file tree 5 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 1
- .mat-tab-group {
2
- margin-bottom : 48px ;
1
+ .example-action-button {
2
+ margin-top : 8px ;
3
+ margin-bottom : 8px ;
4
+ margin-right : 8px ;
3
5
}
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
/**
@@ -9,6 +10,8 @@ import {MatTabsModule} from '@angular/material/tabs';
9
10
templateUrl : 'tab-group-align-example.html' ,
10
11
styleUrl : 'tab-group-align-example.css' ,
11
12
standalone : true ,
12
- imports : [ MatTabsModule ] ,
13
+ imports : [ MatTabsModule , MatButtonModule ] ,
13
14
} )
14
- export class TabGroupAlignExample { }
15
+ export class TabGroupAlignExample {
16
+ alignment : 'start' | 'center' | 'end' = 'start' ;
17
+ }
Original file line number Diff line number Diff line change @@ -25,4 +25,4 @@ <h3>Inverted Tabs</h3>
25
25
< h3 > Ink bar fit to content</ h3 >
26
26
< tab-group-ink-bar-example > </ tab-group-ink-bar-example >
27
27
< h3 > Tab group with the headers on the bottom</ h3 >
28
- < tab-group-header-below-example > </ tab-group-header-below-example >
28
+ < tab-group-header-below-example > </ tab-group-header-below-example >
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