# \[aria-posinset\]

> The `aria-posinset` ARIA attribute specifies the position of an item within a set.

## How does aria-posinset work in a virtualized list?

The attribute that indicates the position of an item within a set or list. It helps users understand the item's location relative to other items in the set, such as its position in a list.

- Topic: Relationship Attributes
- Type: attribute

## Example

Wrong:

```html
<div role="feed">
  <article aria-posinset="0" aria-setsize="-1">First post</article>
</div>
```

Right:

```html
<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-posinset` values are 1-based and reflect the item position in the full set, not in the rendered slice.
- `aria-posinset` is paired with `aria-setsize` on 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.

## Related cards

- [\[aria-setsize\]](https://wonderium.dev/a11y/aria-setsize.md)
- [listbox](https://wonderium.dev/a11y/listbox.md)
- [\[aria-rowindex\]](https://wonderium.dev/a11y/aria-rowindex.md)
- [article](https://wonderium.dev/a11y/article.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/aria-posinset
- Last updated: 2026-11-25
