File tree Expand file tree Collapse file tree 7 files changed +53
-1
lines changed
components-examples/material/tabs Expand file tree Collapse file tree 7 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 1
1
export { TabGroupAlignExample } from './tab-group-align/tab-group-align-example' ;
2
+ export { TabGroupDynamicAlignExample } from './tab-group-dynamic-align/tab-group-dynamic-align-example' ;
2
3
export { TabGroupAnimationsExample } from './tab-group-animations/tab-group-animations-example' ;
3
4
export { TabGroupAsyncExample } from './tab-group-async/tab-group-async-example' ;
4
5
export { TabGroupBasicExample } from './tab-group-basic/tab-group-basic-example' ;
Original file line number Diff line number Diff line change
1
+ .example-action-button {
2
+ margin-top : 8px ;
3
+ margin-bottom : 8px ;
4
+ margin-right : 8px ;
5
+ }
Original file line number Diff line number Diff line change
1
+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'start' ">
2
+ Start
3
+ </ button >
4
+
5
+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'center' ">
6
+ Center
7
+ </ button >
8
+
9
+ < button mat-raised-button class ="example-action-button " (click) ="alignment = 'end' ">
10
+ End
11
+ </ button >
12
+
13
+ <!-- #docregion dynamic-align-start -->
14
+ < mat-tab-group mat-stretch-tabs ="false " [mat-align-tabs] ="alignment ">
15
+ < mat-tab label ="First "> Content 1</ mat-tab >
16
+ < mat-tab label ="Second "> Content 2</ mat-tab >
17
+ < mat-tab label ="Third "> Content 3</ mat-tab >
18
+ </ mat-tab-group >
19
+ <!-- #docregion dynamic-align-end -->
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core' ;
2
+ import { MatButtonModule } from '@angular/material/button' ;
3
+ import { MatTabsModule } from '@angular/material/tabs' ;
4
+
5
+ /**
6
+ * @title Tab group with dynamically aligned labels
7
+ */
8
+ @Component ( {
9
+ selector : 'tab-group-dynamic-align-example' ,
10
+ templateUrl : 'tab-group-dynamic-align-example.html' ,
11
+ styleUrl : 'tab-group-dynamic-align-example.css' ,
12
+ standalone : true ,
13
+ imports : [ MatTabsModule , MatButtonModule ] ,
14
+ } )
15
+ export class TabGroupDynamicAlignExample {
16
+ alignment : 'start' | 'center' | 'end' = 'start' ;
17
+ }
Original file line number Diff line number Diff line change 1
1
< h3 > Tab group alignment</ h3 >
2
2
< tab-group-align-example > </ tab-group-align-example >
3
+ < h3 > Tab group dynamic alignment</ h3 >
4
+ < tab-group-dynamic-align-example > </ tab-group-dynamic-align-example >
3
5
< h3 > Tab group animations</ h3 >
4
6
< tab-group-animations-example > </ tab-group-animations-example >
5
7
< h3 > Tab group async</ h3 >
@@ -25,4 +27,4 @@ <h3>Inverted Tabs</h3>
25
27
< h3 > Ink bar fit to content</ h3 >
26
28
< tab-group-ink-bar-example > </ tab-group-ink-bar-example >
27
29
< h3 > Tab group with the headers on the bottom</ h3 >
28
- < tab-group-header-below-example > </ tab-group-header-below-example >
30
+ < tab-group-header-below-example > </ tab-group-header-below-example >
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
21
21
TabGroupPaginatedExample ,
22
22
TabGroupStretchedExample ,
23
23
TabNavBarBasicExample ,
24
+ TabGroupDynamicAlignExample ,
24
25
} from '@angular/components-examples/material/tabs' ;
25
26
import { ChangeDetectionStrategy , Component } from '@angular/core' ;
26
27
import { MatTabsModule } from '@angular/material/tabs' ;
@@ -44,6 +45,7 @@ import {MatTabsModule} from '@angular/material/tabs';
44
45
TabGroupBasicExample ,
45
46
TabGroupCustomLabelExample ,
46
47
TabGroupDynamicHeightExample ,
48
+ TabGroupDynamicAlignExample ,
47
49
MatTabsModule ,
48
50
] ,
49
51
changeDetection : ChangeDetectionStrategy . OnPush ,
Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ do so using the `[mat-align-tabs]` attribute.
76
76
"file": "tab-group-align-example.html",
77
77
"region": "align-start"}) -->
78
78
79
+ Alternatively you can also use ` [mat-align-tabs] ` input which takes either ` start ` , ` center ` or ` end ` .
80
+
81
+ <!-- example({"example": "tab-group-dynamic-align",
82
+ "file": "tab-group-dynamic-align-example.html",
83
+ "region": "dynamic-align-start"}) -->
84
+
79
85
### Controlling the tab animation
80
86
You can control the duration of the tabs' animation using the ` animationDuration ` input. If you
81
87
want to disable the animation completely, you can do so by setting the properties to ` 0ms ` . The
You can’t perform that action at this time.
0 commit comments