ARIA Widget Roles
ARIA role: treegrid
A hierarchical grid with expandable rows and interactive navigation. Requires rows and cells plus a consistent row/cell navigation model and real expansion. 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="treegrid"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token treegrid; 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. |
Working Example
Example Snippethtml
<div role="treegrid" aria-label="Files"> <div role="row" aria-expanded="false" tabindex="0"> <div role="gridcell">Projects</div> </div></div>