-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs: add remaining component overviews #2338
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
Show all changes
17 commits
Select commit
Hold shift + click to select a range
810160b
snackbar overview
jelbourn def7d47
menu overview
jelbourn d89623e
list overview
jelbourn c0f7375
slide-toggle
jelbourn 1519975
sidenav overview
jelbourn dc15000
progress overview
jelbourn bb20ccc
radio overview
jelbourn 30e3249
toolbar overview
jelbourn 8e3fee0
slider overview
jelbourn a2a6739
select overview
jelbourn a94e7f1
nav-tabs
jelbourn f2c31ec
chips
jelbourn 22ef0a4
consistency
jelbourn 75b2da2
input edits
jelbourn b707204
fix typo in radio
jelbourn b9348dc
correct radio overview example name
jelbourn bd804bb
mention hammer, fix typos
jelbourn 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ <h4>Stacked Chips</h4> | |
</md-chip-list> | ||
</md-card-content> | ||
</md-card> | ||
</div> | ||
</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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
`<md-chip-list>` displays a list of values as individual chips. | ||
|
||
<!-- example(chips-overview) --> | ||
|
||
_Note: chips are still early in their development and more features are being actively worked on._ | ||
|
||
```html | ||
<md-chip-list> | ||
<md-chip>Papadum</md-chip> | ||
<md-chip>Naan</md-chip> | ||
<md-chip>Dal</md-chip> | ||
</md-chip-list> | ||
``` | ||
|
||
### Unstyled chips | ||
By default, `<md-chip>` has Material Design styles applied. For a chip with no styles applied, | ||
use `<md-basic-chip>`. You can then customize the chip appearance by adding your own CSS. | ||
|
||
### Selection | ||
Chips can be selected via the `selected` property. Selection can be disabled by setting | ||
`selectable` to `false` on the `<md-chip-list>`. | ||
|
||
### Keyboard interation | ||
Users can move through the chips using the arrow keys and select them with the space. | ||
|
||
|
||
### Theming | ||
The color of an `<md-chip>` can be changed by using the `color` property. By default, chips | ||
use a neutral background color based on the current theme (light or dark). This can be changed to | ||
`'primary'`, `'accent'`, or `'warn'`. |
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
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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
`<md-list>` is a container component that wraps and formats a series of line items. As the base | ||
list component, it provides Material Design styling, but no behavior of its own. | ||
|
||
<!-- example(list-overview) --> | ||
|
||
|
||
### Simple lists | ||
|
||
An `<md-list>` element contains a number of `<md-list-item>` elements. | ||
|
||
```html | ||
<md-list> | ||
<md-list-item> Pepper </md-list-item> | ||
<md-list-item> Salt </md-list-item> | ||
<md-list-item> Paprika </md-list-item> | ||
</md-list> | ||
``` | ||
|
||
### Navigation lists | ||
|
||
Use `md-nav-list` tags for navigation lists (i.e. lists that have anchor tags). | ||
|
||
Simple navigation lists can use the `md-list-item` attribute on anchor tag elements directly: | ||
|
||
```html | ||
<md-nav-list> | ||
<a md-list-item href="..." *ngFor="let link of links"> {{ link }} </a> | ||
</md-nav-list> | ||
``` | ||
|
||
For more complex navigation lists (e.g. with more than one target per item), wrap the anchor | ||
element in an `<md-list-item>`. | ||
|
||
```html | ||
<md-nav-list> | ||
<md-list-item *ngFor="let link of links"> | ||
<a md-line href="...">{{ link }}</a> | ||
<button md-icon-button (click)="showInfo(link)"> | ||
<md-icon>info</md-icon> | ||
</button> | ||
</md-list-item> | ||
</md-nav-list> | ||
``` | ||
|
||
### Multi-line lists | ||
For lists that require multiple lines per item, annotate each line with an `md-line` attribute. | ||
Whichever heading tag is appropriate for your DOM hierarchy should be used (not necesarily `<h3>` | ||
as shown in the example). | ||
|
||
```html | ||
<!-- two line list --> | ||
<md-list> | ||
<md-list-item *ngFor="let message of messages"> | ||
<h3 md-line> {{message.from}} </h3> | ||
<p md-line> | ||
<span> {{message.subject}} </span> | ||
<span class="demo-2"> -- {{message.content}} </span> | ||
</p> | ||
</md-list-item> | ||
</md-list> | ||
|
||
<!-- three line list --> | ||
<md-list> | ||
<md-list-item *ngFor="let message of messages"> | ||
<h3 md-line> {{message.from}} </h3> | ||
<p md-line> {{message.subject}} </p> | ||
<p md-line class="demo-2"> {{message.content}} </p> | ||
</md-list-item> | ||
</md-list> | ||
``` | ||
|
||
### Lists with avatars | ||
To include an avatar, add an image tag with an `md-list-avatar` attribute. | ||
|
||
```html | ||
<md-list> | ||
<md-list-item *ngFor="let message of messages"> | ||
<img md-list-avatar src="..." alt="..."> | ||
<h3 md-line> {{message.from}} </h3> | ||
<p md-line> | ||
<span> {{message.subject}} </span> | ||
<span class="demo-2"> -- {{message.content}} </span> | ||
</p> | ||
</md-list-item> | ||
</md-list> | ||
``` | ||
|
||
### Dense lists | ||
Lists are also available in "dense layout" mode, which shrinks the font size and height of the list | ||
to suit UIs that may need to display more information. To enable this mode, add a `dense` attribute | ||
to the main `md-list` tag. | ||
|
||
|
||
```html | ||
<md-list dense> | ||
<md-list-item> Pepper </md-list-item> | ||
<md-list-item> Salt </md-list-item> | ||
<md-list-item> Paprika </md-list-item> | ||
</md-list> | ||
``` | ||
|
||
|
||
### Lists with multiple sections | ||
|
||
Subheader can be added to a list by annotating a heading tag with an `md-subheader` attribute. | ||
To add a divider, use `<md-divider>`. | ||
|
||
```html | ||
<md-list> | ||
<h3 md-subheader>Folders</h3> | ||
<md-list-item *ngFor="let folder of folders"> | ||
<md-icon md-list-avatar>folder</md-icon> | ||
<h4 md-line>{{folder.name}}</h4> | ||
<p md-line class="demo-2"> {{folder.updated}} </p> | ||
</md-list-item> | ||
<md-divider></md-divider> | ||
<h3 md-subheader>Notes</h3> | ||
<md-list-item *ngFor="let note of notes"> | ||
<md-icon md-list-avatar>note</md-icon> | ||
<h4 md-line>{{note.name}}</h4> | ||
<p md-line class="demo-2"> {{note.updated}} </p> | ||
</md-list-item> | ||
</md-list> | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
`<md-menu>` is a floating panel containing list of options. | ||
|
||
<!-- example(menu-overview) --> | ||
|
||
By itself, the `<md-menu>` element does not render anything. The menu is attached to and opened | ||
via application of the `mdMenuTriggerFor` directive: | ||
```ts | ||
<md-menu #appMenu="mdMenu"> | ||
<button md-menu-item> Settings </button> | ||
<button md-menu-item> Help </button> | ||
</md-menu> | ||
|
||
<button md-icon-button [mdMenuTriggerFor]="appMenu"> | ||
<md-icon>more_vert</md-icon> | ||
</button> | ||
``` | ||
|
||
### Toggling the menu programmatically | ||
The menu exposes an API to open/close programmatically. Please note that in this case, an | ||
`mdMenuTriggerFor` directive is still necessary to attach the menu to a trigger element in the DOM. | ||
|
||
```ts | ||
class MyComponent { | ||
@ViewChild(MdMenuTrigger) trigger: MdMenuTrigger; | ||
|
||
someMethod() { | ||
this.trigger.openMenu(); | ||
} | ||
} | ||
``` | ||
|
||
### Icons | ||
Menus support displaying `md-icon` elements before the menu item text. | ||
|
||
*my-comp.html* | ||
```html | ||
<md-menu #menu="mdMenu"> | ||
<button md-menu-item> | ||
<md-icon> dialpad </md-icon> | ||
<span> Redial </span> | ||
</button> | ||
<button md-menu-item disabled> | ||
<md-icon> voicemail </md-icon> | ||
<span> Check voicemail </span> | ||
</button> | ||
<button md-menu-item> | ||
<md-icon> notifications_off </md-icon> | ||
<span> Disable alerts </span> | ||
</button> | ||
</md-menu> | ||
``` | ||
|
||
### Customizing menu position | ||
|
||
By default, the menu will display after and below its trigger. The position can be changed | ||
using the `x-position` (`before | after`) and `y-position` (`above | below`) attributes. | ||
|
||
|
||
### Keyboard interaction | ||
- <kbd>DOWN_ARROW</kbd>: Focuses the next menu item | ||
- <kbd>UP_ARROW</kbd>: Focuses previous menu item | ||
- <kbd>ENTER</kbd>: Activates the focused menu item |
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.
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.
"an
mdMenuTriggerFor
directive" -> "amdMenuTriggerFor
directive"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.
I think
an
is right when the following word starts with the "em" sound.