Skip to content

Commit

Permalink
fix(material/list): add example of matListItemMeta for meta section icon
Browse files Browse the repository at this point in the history
resolves #26415
  • Loading branch information
im100ra committed Nov 22, 2024
1 parent 23c19be commit 54fce2c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/material/list/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ To add an icon to your list item, use the `matListItemIcon` attribute.
</mat-list>
```

### Lists with meta section icons

To add a meta icon to your list item, use the `matListItemMeta` directive. This allows you to display an icon or any other content in the meta section of the list item.


```html
<mat-list>
@for (message of messages; track message) {
<mat-list-item>
<div matListItemMeta>
<mat-icon>folder</mat-icon>
</div>
<h3 matListItemTitle>{{message.from}}</h3>
<p matListItemLine>
<span>{{message.subject}}</span>
<span class="demo-2"> -- {{message.content}}</span>
</p>
</mat-list-item>
}
</mat-list>
```

### Lists with avatars

To include an avatar image, add an image tag with an `matListItemAvatar` attribute.
Expand Down

0 comments on commit 54fce2c

Please sign in to comment.