Skip to content

Commit 78464a2

Browse files
dasoistinayuangao
authored andcommitted
feat(tabs): md-stretch-tabs (#1909)
Stretch tabs grow until they fill the tab group width. Closes #1353
1 parent bc6cf6e commit 78464a2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/demo-app/tabs/tabs-demo.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ <h1>Tab Group Demo - Fixed Height</h1>
9797
</md-tab>
9898
</md-tab-group>
9999

100+
<h1>Stretched Tabs</h1>
101+
102+
<md-tab-group class="demo-tab-group" style="height: 200px" md-stretch-tabs>
103+
<md-tab *ngFor="let tab of tabs" [disabled]="tab.disabled">
104+
<template md-tab-label>{{tab.label}}</template>
105+
{{tab.content}}
106+
</md-tab>
107+
</md-tab-group>
108+
100109

101110
<h1>Async Tabs</h1>
102111

src/lib/tabs/tab-group.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
}
2626
}
2727

28+
:host[md-stretch-tabs] .md-tab-label {
29+
flex-basis: 0;
30+
flex-grow: 1;
31+
}
32+
2833
// The ink bar that displays next to the active tab
2934
md-ink-bar {
3035
@include ink-bar;

0 commit comments

Comments
 (0)