-
Notifications
You must be signed in to change notification settings - Fork 6.8k
prototype(tabs): create prototype tabs based on MDC web #16805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,113 @@ | ||
<!-- TODO: copy in demo template from existing tabs demo. --> | ||
Not yet implemented. | ||
<div class="mat-typography"> | ||
<h2>Paginated tabs</h2> | ||
<mat-tab-group> | ||
<mat-tab [label]="tab" *ngFor="let tab of lotsOfTabs">Content</mat-tab> | ||
</mat-tab-group> | ||
|
||
<h2>Themed tabs</h2> | ||
<mat-tab-group [color]="'primary'"> | ||
<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="Fourth" disabled>Content 4</mat-tab> | ||
</mat-tab-group> | ||
|
||
<mat-tab-group [color]="'accent'"> | ||
<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="Fourth" disabled>Content 4</mat-tab> | ||
</mat-tab-group> | ||
|
||
<mat-tab-group [color]="'warn'"> | ||
<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="Fourth" disabled>Content 4</mat-tab> | ||
</mat-tab-group> | ||
|
||
<h2>Stretched tabs</h2> | ||
<mat-tab-group mat-stretch-tabs> | ||
<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-group> | ||
|
||
<h2>Aligned tabs</h2> | ||
<mat-tab-group mat-align-tabs="start"> | ||
<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-group> | ||
|
||
<mat-tab-group mat-align-tabs="center"> | ||
<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-group> | ||
|
||
<mat-tab-group mat-align-tabs="end"> | ||
<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-group> | ||
|
||
<h2>Inverted tabs</h2> | ||
<mat-tab-group headerPosition="below"> | ||
<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-group> | ||
|
||
<h2>Tabs with background color</h2> | ||
<div> | ||
<mat-button-toggle-group #backgroundColorToggle="matButtonToggleGroup" | ||
value="primary" | ||
aria-label="Change color"> | ||
<mat-button-toggle value="primary">Primary</mat-button-toggle> | ||
<mat-button-toggle value="accent">Accent</mat-button-toggle> | ||
<mat-button-toggle value="warn">Warn</mat-button-toggle> | ||
</mat-button-toggle-group> | ||
</div> | ||
|
||
<mat-tab-group [backgroundColor]="backgroundColorToggle.value"> | ||
<mat-tab [label]="tab" *ngFor="let tab of lotsOfTabs">Content</mat-tab> | ||
</mat-tab-group> | ||
|
||
<h2>Template labels</h2> | ||
|
||
<mat-tab-group> | ||
<mat-tab> | ||
<ng-template mat-tab-label>One</ng-template> | ||
First tab's content | ||
</mat-tab> | ||
<mat-tab> | ||
<ng-template mat-tab-label>Two</ng-template> | ||
Second tab's content | ||
</mat-tab> | ||
<mat-tab> | ||
<ng-template mat-tab-label>Three</ng-template> | ||
Third tab's content | ||
</mat-tab> | ||
</mat-tab-group> | ||
|
||
<h2>Lazy tabs</h2> | ||
<mat-tab-group> | ||
<mat-tab label="One"> | ||
Eager | ||
</mat-tab> | ||
<mat-tab label="Two"> | ||
<ng-template matTabContent> | ||
<div class="child">Lazy</div> | ||
</ng-template> | ||
</mat-tab> | ||
</mat-tab-group> | ||
|
||
<h2>Tab nav bar</h2> | ||
<nav mat-tab-nav-bar> | ||
<a mat-tab-link *ngFor="let link of links" | ||
(click)="activeLink = link" | ||
[active]="activeLink == link">{{link}}</a> | ||
<a mat-tab-link disabled>Disabled Link</a> | ||
</nav> | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
// TODO: copy in demo styles from existing tabs demo. | ||
mat-tab-group { | ||
margin-bottom: 32px; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
<!-- TODO: copy implementation from existing tabs e2e page. --> | ||
<section> | ||
<mat-tab-group> | ||
<mat-tab> | ||
<ng-template mat-tab-label>One</ng-template> | ||
<mat-form-field> | ||
<textarea matInput placeholder="Autosize textarea" cdkTextareaAutosize>This is an autosize textarea, it should adjust to the size of its content.</textarea> | ||
</mat-form-field> | ||
</mat-tab> | ||
<mat-tab> | ||
<ng-template mat-tab-label>Two</ng-template> | ||
Second tab's content | ||
</mat-tab> | ||
<mat-tab> | ||
<ng-template mat-tab-label>Three</ng-template> | ||
Third tab's content | ||
</mat-tab> | ||
</mat-tab-group> | ||
</section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.