ARIA Widget Roles
ARIA role: grid
A composite of rows and cells with managed keyboard navigation. Requires rows with cells and a managed focus model. Arrow keys navigate cells; editing requires its own mode. Static structure only, not a working grid. Explicit roles do not implement visual presentation, interaction or focus management; verify allowed role/element combinations in ARIA in HTML. Accessibility exposure varies with browser, platform and assistive technology. Test relevant combinations; rendering is not proof of accessibility.
Formal Syntax & Structure
html syntaxhtml
role="grid"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token grid; use only where allowed. Omit when native semantics match. |
| aria-rowcount | integer | Relevant when applicable. Reports the total row count, including header rows, when only part of a table or grid is rendered. Use -1 for unknown total. Pair with consistent aria-rowindex values. Values: positive integer or -1. |
| aria-colcount | integer | Relevant when applicable. Reports the total number of columns in a table or grid when some columns are absent from the DOM. Use -1 if the total is unknown. Supply consistent column indices for the rendered subset. Values: positive integer or -1. |
| aria-multiselectable | boolean | Relevant when applicable. Indicates that more than one item can be selected in a composite widget. Keep each item's selection state synchronized and implement its multi-selection interaction. Prefer select multiple for simple lists. Values: true, false. |
Working Example
Example Snippethtml
<div role="grid" aria-label="Inventory"> <div role="row"> <div role="gridcell" tabindex="0">Pens</div> <div role="gridcell" tabindex="-1">4</div> </div></div>