Tree view
ProA hierarchy of rows that open and fold, with selection, their own controls and children that load. Not an M3 component (@windmorph/react-pro).
import { TreeView, TreeViewItemContent } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Keyboard
| Key | Action |
|---|---|
| Tab | Moves into and out of the tree, which is one tab stop. |
| Arrow Up or Arrow Down | Move between rows. |
| Arrow Right | Opens a closed row, then moves into its controls. |
| Arrow Left | Closes an open row, or moves out of its controls. |
| Home or End | Move to the first or last row. |
| Enter or Space | Activates or selects the row. |
- Typing moves to the next row starting with those letters.
- Left and Right mirror in right to left.
Screen reader
- Role
- A
treegridwithrowandgridcell. - Accessible name
- From
aria-labeloraria-labelledby, which the types require. Each row is named by itstextValue. - States announced
aria-expanded,aria-level,aria-posinset,aria-setsizeandaria-selected.
A loading or failed row is a real row, so a keyboard can reach its retry.
Focus
Each row shows the M3 focus indicator from the keyboard.
Touch target
Rows and expand buttons are 48px at density 0 and lose 4px a density step.
Motion
- The chevron turns on the fast spatial spring and snaps under reduced motion.
- In forced colours a selected row keeps an edge.
What you need to do
- Give the tree a name, and return a useful
textValuefor each row. - Name any control in a row after that row.