Tree
File-style tree: branches fold, leaves select, lazy branches load; WAI-ARIA keys.
Group: Lists · Kind: macro · in the lite catalog
Preview
Section titled “Preview”files
apps
web
main.ts
router.ts
desktop
packages
ui
README.md
package.json
hasChildren · loading
apps
web
desktop
Loading
packages
README.md
package.json
Platforms
Section titled “Platforms”The same specimen painted by React, SwiftUI, Compose and gpui.




| Prop | Type | Required | Bindable | Description |
|---|---|---|---|---|
items |
[treeItem] |
yes | – | Root nodes. |
expanded |
[string] |
– | yes | Open branch ids; bind it. |
value |
string |
– | yes | Selected leaf id. |
label |
string |
– | – | Accessible name. |
Events
Section titled “Events”on.select: runs an actionon.toggle: runs an actionon.load: runs an action
None.
Children
Section titled “Children”none
A2UI basic mapping
Section titled “A2UI basic mapping”No basic catalog component maps here.
Built from
Section titled “Built from”Accessibility
Section titled “Accessibility”Role: tree
tree labelled label (else $string.tree); every node a treeitem with aria-level, aria-expanded on a branch, aria-selected; the loading row and the chevron are decorative
| Keys | Action |
|---|---|
ArrowDown ArrowUp |
the next, previous visible node |
Home End |
the first, last node |
ArrowRight |
open a closed branch, else its first child |
ArrowLeft |
close an open branch, else its parent |
Enter Space |
select a leaf, fold a branch |
Theming
Section titled “Theming”Recipe parts: Tree/root Tree/row Tree/lead Tree/foldIcon Tree/spinner
Keyed by: open :hover :pressed :focus :disabled :checked :open :selected :invalid :dragover :warning :info
Related
Section titled “Related”Icon · Row · Spinner · Sidebar · Section · Group · Trace · TraceItem