Skip to content

Commit 948209f

Browse files
authored
docs(infinite-scroll): accessibility best practice for role="feed" (#2509)
1 parent b99957f commit 948209f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/api/infinite-scroll.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,34 @@ Infinite scroll requires a scroll container to function. When using a virtual sc
6161
</ion-content>
6262
```
6363

64+
## Accessibility
65+
66+
Developers should assign the `role="feed"` attribute to the scrollable list of items that are added to or removed from as the user scrolls.
67+
68+
Individual list items should either have `role="article"` or use the `<article>` element directly.
69+
70+
For example, when rendering a collection of items in an `ion-list`:
71+
72+
```html
73+
<ion-content role="feed">
74+
<ion-list>
75+
<ion-item role="article">
76+
First item
77+
</ion-item>
78+
<ion-item role="article">
79+
Second item
80+
</ion-item>
81+
...
82+
</ion-list>
83+
84+
<ion-infinite-scroll>
85+
<ion-infinite-scroll-content></ion-infinite-scroll-content>
86+
</ion-infinite-scroll>
87+
</ion-content>
88+
```
89+
90+
Please refer to the [ARIA: feed role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/feed_role) documentation for additional information.
91+
6492
## Interfaces
6593

6694
### InfiniteScrollCustomEvent

0 commit comments

Comments
 (0)