Skip to content

docs(list): add docs for md-list-icon #3015

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 1 commit into from
Feb 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/lib/list/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,27 @@ as shown in the example).
</md-list>
```

### Lists with icons

To add an icon to your list item, use the `md-list-icon` attribute.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should use the mat- prefix from now on?

Copy link
Contributor Author

@kara kara Feb 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most people will want to use md- in their templates, unless they are using both Angular Material and AngularJS Material. The mat prefix is only universal for overriding classes.



```html
<md-list>
<md-list-item *ngFor="let message of messages">
<md-icon md-list-icon>folder</md-icon>
<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>
```

### Lists with avatars
To include an avatar, add an image tag with an `md-list-avatar` attribute.

To include an avatar image, add an image tag with an `md-list-avatar` attribute.

```html
<md-list>
Expand Down