SPECIAL PRICING
BLACK FRIDAY SALE
PERSONAL $99
TEAM $349
ENDS DEC 1
GET IT NOW

Tabs

Angular Material Tabs organize content into separate views, showing only one view at a time for focused interaction. The labels can sit at the start of the row or stretch to fill the full width, each one can carry an icon, and a disabled label stays greyed out while the active one is underlined. BuilderKit restyles the labels, the ink bar and the content area so the mat-tab-group component matches the rest of the design system.

A label can be plain markup instead of a string, so anything can sit next to the text, for example an icon or a counter.

Example

A default tab group, where the labels stretch to fill the full width and the disabled attribute grays out a tab.

Content 1
<mat-tab-group>
<mat-tab label="First">Content 1</mat-tab>
<mat-tab label="Second">Content 2</mat-tab>
<mat-tab label="Third">Content 3</mat-tab>
<mat-tab label="Forth" disabled>Content 4</mat-tab>
</mat-tab-group>

Alignment

mat-stretch-tabs="false" shrinks each label to its text, and mat-align-tabs pushes the row to the start, the center or the end.

Content 1
Content 1
Content 1
<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="start">
<mat-tab label="Daily">Content 1</mat-tab>
<mat-tab label="Weekly">Content 2</mat-tab>
<mat-tab label="Monthly">Content 3</mat-tab>
</mat-tab-group>

<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="center">
<mat-tab label="Daily">Content 1</mat-tab>
<mat-tab label="Weekly">Content 2</mat-tab>
<mat-tab label="Monthly">Content 3</mat-tab>
</mat-tab-group>

<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="end">
<mat-tab label="Daily">Content 1</mat-tab>
<mat-tab label="Weekly">Content 2</mat-tab>
<mat-tab label="Monthly">Content 3</mat-tab>
</mat-tab-group>

Fit ink bar to content

The fitInkBarToContent attribute shortens the underline to the width of the label text.

Content 1
<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="start" fitInkBarToContent>
<mat-tab label="First">Content 1</mat-tab>
<mat-tab label="Second">Content 2</mat-tab>
<mat-tab label="Third">Content 3</mat-tab>
<mat-tab label="Forth" disabled>Content 4</mat-tab>
</mat-tab-group>

Tabs with icons

A label can be an ng-template marked with mat-tab-label rather than a string, which leaves room for an icon beside the text and keeps the underline aligned with the whole label.

Content 1
<mat-tab-group>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon class="me-2 size-4" svgIcon="house" />
Overview
</ng-template>
Content 1
</mat-tab>

<mat-tab>
<ng-template mat-tab-label>
<mat-icon class="me-2 size-4" svgIcon="chart-line" />
Reports
</ng-template>
Content 2
</mat-tab>
</mat-tab-group>