Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(button): enhance button docs and examples#8536
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /** No CSS for this example */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <mat-card> | ||
| <mat-card-header> | ||
| <mat-card-title>Card with action buttons</mat-card-title> | ||
| </mat-card-header> | ||
| <mat-card-actions align="end"> | ||
| <button mat-button aria-label="Example cancel button in card">Cancel</button> | ||
| <button mat-button aria-label="Example accept button in card" color="primary">Accept</button> | ||
| </mat-card-actions> | ||
| </mat-card> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {Component} from '@angular/core'; | ||
| /** | ||
| * @title Button usage in cards | ||
| */ | ||
| @Component({ | ||
| selector: 'button-card-example', | ||
| templateUrl: 'button-card-example.html', | ||
| styleUrls: ['button-card-example.css'], | ||
| }) | ||
| export class ButtonCardExample {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,16 @@ | ||
| /** No CSS for this example */ | ||
| .example-button-row { | ||
| background: #f3f3f3; | ||
| padding: 16px; | ||
| border-radius: 3px; | ||
| display: flex; | ||
| justify-content: center; | ||
| } | ||
| .example-button-row .mat-button, | ||
| .example-button-row .mat-raised-button, | ||
| .example-button-row .mat-icon-button, | ||
| .example-button-row .mat-fab, | ||
| .example-button-row .mat-mini-fab { | ||
| text-transform: uppercase; | ||
| margin: 0 8px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,76 @@ | ||
| <button mat-button>Click me!</button> | ||
| <h3>Basic Buttons</h3> | ||
| <div class="example-button-row"> | ||
| <button mat-button aria-label="Example flat button">Basic</button> | ||
| <button mat-button aria-label="Example flat primary colored button" color="primary">Primary</button> | ||
| <button mat-button aria-label="Example flat accent colored button" color="accent">Accent</button> | ||
| <button mat-button aria-label="Example flat warn colored button" color="warn">Warn</button> | ||
| <button mat-button aria-label="Example flat disabled button" disabled>Disabled</button> | ||
| <a mat-button aria-label="Example flat anchor button" routerLink=".">Link</a> | ||
| </div> | ||
| <h3>Raised Buttons</h3> | ||
| <div class="example-button-row"> | ||
| <button mat-raised-button aria-label="Example raised button">Basic</button> | ||
| <button mat-raised-button aria-label="Example raised primary colored button" color="primary">Primary</button> | ||
| <button mat-raised-button aria-label="Example raised accent colored button" color="accent">Accent</button> | ||
| <button mat-raised-button aria-label="Example raised warn colored button" color="warn">Warn</button> | ||
| <button mat-raised-button aria-label="Example raised disabled button" disabled>Disabled</button> | ||
| <a mat-raised-button aria-label="Example raised anchor button" routerLink=".">Link</a> | ||
| </div> | ||
| <h3>Icon Buttons</h3> | ||
| <div class="example-button-row"> | ||
| <button mat-icon-button aria-label="Example icon-button with a heart icon"> | ||
| <mat-icon>favorite</mat-icon> | ||
| </button> | ||
| <button mat-icon-button color="primary" aria-label="Example icon-button with a more vertical icon"> | ||
| <mat-icon>more_vert</mat-icon> | ||
| </button> | ||
| <button mat-icon-button color="accent" aria-label="Example icon-button with a launch icon"> | ||
| <mat-icon>launch</mat-icon> | ||
| </button> | ||
| <button mat-icon-button color="warn" aria-label="Example icon-button with a menu icon"> | ||
| <mat-icon>menu</mat-icon> | ||
| </button> | ||
| <button mat-icon-button disabled aria-label="Example icon-button with a close icon"> | ||
| <mat-icon>close</mat-icon> | ||
| </button> | ||
| </div> | ||
| <h3>Fab Buttons</h3> | ||
| <div class="example-button-row"> | ||
| <button mat-fab aria-label="Example icon-button with a people icon"> | ||
| <mat-icon>add</mat-icon> | ||
| </button> | ||
| <button mat-fab color="primary" aria-label="Example icon-button with a people icon"> | ||
| <mat-icon>people</mat-icon> | ||
| </button> | ||
| <button mat-fab color="warn" aria-label="Example icon-button with a star icon"> | ||
| <mat-icon>star</mat-icon> | ||
| </button> | ||
| <button mat-fab disabled aria-label="Example icon-button with a comment icon"> | ||
| <mat-icon>comment</mat-icon> | ||
| </button> | ||
| <button mat-fab aria-label="Example icon-button with a cake icon"> | ||
| <mat-icon>cake</mat-icon> | ||
| </button> | ||
| </div> | ||
| <h3>Mini Fab Buttons</h3> | ||
| <div class="example-button-row"> | ||
| <button mat-mini-fab aria-label="Example icon-button with a people icon"> | ||
| <mat-icon>add</mat-icon> | ||
| </button> | ||
| <button mat-mini-fab color="primary" aria-label="Example icon-button with a people icon"> | ||
| <mat-icon>people</mat-icon> | ||
| </button> | ||
| <button mat-mini-fab color="warn" aria-label="Example icon-button with a star icon"> | ||
| <mat-icon>star</mat-icon> | ||
| </button> | ||
| <button mat-mini-fab disabled aria-label="Example icon-button with a comment icon"> | ||
| <mat-icon>comment</mat-icon> | ||
| </button> | ||
| <button mat-mini-fab aria-label="Example icon-button with a cake icon"> | ||
| <mat-icon>cake</mat-icon> | ||
| </button> | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .example-spacer { | ||
| flex: 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <mat-toolbar color="primary"> | ||
| <button mat-icon-button aria-label="Example icon-button with a menu icon"> | ||
| <mat-icon>menu</mat-icon> | ||
| </button> | ||
| <span>Toolbar with icon buttons</span> | ||
| <span class="example-spacer"></span> | ||
| <button mat-icon-button aria-label="Example icon-button with a more vertical icon"> | ||
| <mat-icon>more_vert</mat-icon> | ||
| </button> | ||
| </mat-toolbar> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {Component} from '@angular/core'; | ||
| /** | ||
| * @title Icon button usage in toolbar | ||
| */ | ||
| @Component({ | ||
| selector: 'button-toolbar-example', | ||
| templateUrl: 'button-toolbar-example.html', | ||
| styleUrls: ['button-toolbar-example.css'], | ||
| }) | ||
| export class ButtonToolbarExample {} | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should end w/ new line