Treegrid
A treegrid is an interactive table with rows that can have child rows. People can open the row levels while cells still line up in columns.
Another example
A finance manager compares departments, teams, and cost centers in Budget, Actual, and Variance columns. Right Arrow opens a department or enters its cells. Closing it removes child rows but keeps focus and totals on the parent row.
Main parts
- 01Hierarchical rows
- 02Column cells
- 03Expansion metadata
Use it when
Use it only when people truly need to open row levels and compare table columns in the same task.
Do not use it when
If its keyboard controls are harder than the task, use a simpler option. Try a tree with a details panel or nested tables.
Name used in code
role=treegrid with row aria-level/expanded and gridcell columns Before you ship
Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states.
Outcome: Use Treegrid to solve this user need without losing the current context. User context: A finance manager compares departments, teams, and cost centers in Budget, Actual, and Variance columns. Right Arrow opens a department or enters its cells. Closing it removes child rows but keeps focus and totals on the parent row. Recommended pattern: Treegrid. Why it fits: Use it only when people truly need to open row levels and compare table columns in the same task. Do not use it when: If its keyboard controls are harder than the task, use a simpler option. Try a tree with a details panel or nested tables. Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary): It is official for that source. Other platforms or teams may use the term in another way. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Check this request
Review the current use of Treegrid. Definition: A treegrid is an interactive table with rows that can have child rows. People can open the row levels while cells still line up in columns. Release checks: Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.