You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/material/list/list.md
+29
Original file line number
Diff line number
Diff line change
@@ -241,6 +241,35 @@ anchors, including buttons and checkboxes.
241
241
Always provide an accessible label for the `<mat-nav-list>` element via `aria-label` or
242
242
`aria-labelledby`.
243
243
244
+
To provide the best screen reader experience for a list, wrap each anchor element with a `<li>` or `<div role="listitem">` element and wrap all of the anchor elements with a `<ul>` element or `<div role="list">` element.
245
+
246
+
```html
247
+
<mat-nav-listaria-label="Select a folder">
248
+
<ul>
249
+
@for (link of list; track link) {
250
+
<li>
251
+
<amat-list-itemhref="..."[activated]="link.isActive">{{ link }}</a>
252
+
</li>
253
+
}
254
+
</ul>
255
+
</mat-nav-list>
256
+
```
257
+
258
+
#### Action
259
+
260
+
To provide the best screen reader experience for a list, wrap each button element with a `<li>` or `<div role="listitem">` element and add `role="list"` to `<mat-action-list>`.
0 commit comments