Selectable and collapsible hierarchy for folder browsers and nested application menus. Unlike Tree View, Tree Menu exposes selection and expansion callbacks.
| Prop | Type | Default | Description |
|---|---|---|---|
nodes | TreeMenuNode[] | — | Nested JSON-driven menu nodes. |
selectedId | string | — | Controlled selected node. |
defaultSelectedId | string | — | Initial uncontrolled selection. |
expandedIds | string[] | — | Controlled expanded branches. |
defaultExpandedIds | string[] | [] | Initially expanded branches. |
onSelect | (node) => void | — | Called when a node is selected. |
onExpandedChange | (ids, node, expanded) => void | — | Called whenever a branch expands or collapses. |
showMeta | boolean | true | Shows optional counts or metadata. |
tree, treeitem, and group roles.aria-expanded and complete accessible labels.aria-selected.