MatList
Themat-list is a container component that displays items in a vertical list format with Material Design styling.
Basic Usage
API Reference
MatList
Selector:mat-list
Basic list container.
MatNavList
Selector:mat-nav-list
List optimized for navigation with anchor or link items.
MatActionList
Selector:mat-action-list
List where each item is a clickable action.
MatListItem
Selector:mat-list-item, a[mat-list-item], button[mat-list-item]
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
activated | boolean | false | Whether an item in a nav-list is the currently active page |
MatListItemTitle
Selector:[matListItemTitle]
Title text within a list item.
MatListItemLine
Selector:[matListItemLine]
Additional line of text within a list item.
MatListItemMeta
Selector:[matListItemMeta]
Trailing metadata content (e.g., icons, text).
MatListItemIcon
Selector:[matListItemIcon]
Icon within a list item.
MatListItemAvatar
Selector:[matListItemAvatar]
Avatar image within a list item.
Examples
Basic List
List with Icons
List with Avatars
Multi-Line List
Navigation List
Action List
List with Dividers
Selection List
Accessibility
Navigation Lists
Nav lists haverole="navigation" applied automatically:
Action Lists
Action lists haverole="group" applied:
Selection Lists
Selection lists haverole="listbox" with proper aria attributes:
Styling
Best Practices
- Appropriate list type: Use nav-list for navigation, action-list for actions
- Consistent structure: Maintain consistent item structure throughout the list
- Clear labels: Use descriptive text for list items
- Visual hierarchy: Use icons, avatars, and metadata appropriately
- Performance: Use
trackBywith*ngForfor large lists