ARIA Widget Roles
ARIA role: gridcell
A cell within an interactive grid or treegrid. Requires row context within a grid or treegrid; implement grid navigation and selection if applicable. Static structure only. 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="gridcell"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token gridcell; use only where allowed. Omit when native semantics match. |
| aria-selected | boolean or undefined | Relevant when applicable. Indicates selection of an item in a widget rather than keyboard focus or the current navigation location. Keep the actual selection model synchronized and use false for selectable but unselected items as appropriate. Values: true, false, undefined. |
| aria-colindex | integer | Relevant when applicable. Identifies the logical column position of a rendered cell when columns are omitted. Use increasing indices within the row and keep them within the known total. When placed on a row, the represented cells must satisfy the specification's contiguity conditions. Values: positive 1-based index. |
| aria-rowindex | integer | Relevant when applicable. Reports the logical position of a row or cell in a partially rendered table or grid, including header rows. Use increasing row indices; where applied to cells they must reflect actual row positions and spans. Values: positive 1-based index. |
Working Example
Example Snippethtml
<div role="grid" aria-label="Inventory"> <div role="row"> <div role="gridcell" tabindex="0">Pens</div> </div></div>