---
title: "ARIA patterns"
description: "Which ARIA roles fit a flat, virtualized grid, and which do not."
canonical_url: "https://vvirtual-grid.netlify.app/reference/aria-patterns"
---
# ARIA patterns

> Which ARIA roles fit a flat, virtualized grid, and which do not.

The grid renders its items as flat children of one element. That structure decides which ARIA roles fit.

## List and listbox

The [`list`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/list_role) and [`listitem`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/listitem_role) roles fit because a list is one element with its items as children, and that is the structure the grid renders. The [`listbox`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/listbox_role) and [`option`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/option_role) roles fit for the same reason. Use them when the items are selectable, and add `aria-selected` to each option. A listbox also needs a way for keyboard users to move between options, such as the roving `tabindex` in the [accessibility guide](https://vvirtual-grid.netlify.app/guides/accessibility#keep-the-focused-index-in-a-ref).

## Grid, row and cell roles

The [`grid`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/grid_role), [`row`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/row_role) and [`gridcell`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/gridcell_role) roles do not fit. A `grid` needs `row` elements that wrap their cells, and the grid renders no row elements. If you need to announce rows and columns, compute the row and column with [`getItemCell`](https://vvirtual-grid.netlify.app/reference/primitives#getitemcell) and write the numbers into `aria-description` on each item. Recompute the description in a `layout-change` handler, because the column count changes when the grid is resized.


## Sitemap

See the full [sitemap](https://vvirtual-grid.netlify.app/sitemap.md) for all pages.
