[aria-posinset]
Example
<div role="feed">
<article aria-posinset="0" aria-setsize="-1">First post</article>
</div><div role="feed" aria-label="Posts">
<article aria-posinset="1" aria-setsize="-1">First post</article>
</div>Positions start at 1, and aria-setsize='-1' means the total is unknown, as in an endless feed.
Common mistakes
- Using the array index of the rendered slice, so every scroll restarts at position 1.
- Using 0-based positions, so items are announced off by one.
Key points
aria-posinsetvalues are 1-based and reflect the item position in the full set, not in the rendered slice.aria-posinsetis paired witharia-setsizeon the same items.
Interview questions
Is aria-posinset needed when all items are in the DOM?
No. Browsers calculate position and size for complete lists, so manual values can only add mistakes.
Can aria-posinset be used without aria-setsize?
It can, but set both so screen readers can say 'item 5 of 50' or 'item 5' with an unknown total.