TreeView
Nested things: file trees, category trees, org charts. Right expands, Left collapses, arrows travel what you can see.
Example
- src
- Button.astro
- Alert.astro
- docs
- package.json
<Tree label="Project files">
<TreeItem id="node-src" label="src">
<TreeItem id="node-button" label="Button.astro" />
</TreeItem>
<TreeItem id="node-docs" label="docs" />
</Tree>Props
| Prop | Type | Default | Description |
|---|---|---|---|
label (Tree) | string | Tree | Landmark name. |
id / label (Item) | string | - | Node identity + text. |
expanded | boolean | false | Open on load. |
Accessibility
- Full tree pattern: arrows, Home/End, Enter toggles, roving tabindex.
- Only visible nodes are reachable; collapsed branches leave the Tab order.