Components · Data Display · Tree
Back to Tree typesTree Experimental
Use for a standalone, always-visible hierarchical structure with expandable branches, like a file system or an org chart - one Tree component, controlled by properties, not a one-off nested list rebuilt per screen. Distinct from Tree Select, which is the same structure behind a Select-style dropdown trigger.
Properties
Root label and icon visibility are properties of the same component, not a separate tree - change them below to check all 3 types and every state in the Live Preview. The node structure itself (Reports/Presentations/Notes.txt) is fixed reference content, matching Cascader's and Tree Select's own fixed demo hierarchies.
Live Preview
All 3 types compared side by side, each in 4 states - Default (collapsed), Expanded (Reports open), Selected (Q1 Report.pdf highlighted or checked) and Disabled. One preview is rendered at the chosen Root label and icon visibility.
Try it
The matrix above renders each state fixed, so all four can be compared at once. This one is live: expand and collapse branches, and check nodes to watch the selection cascade down to children and roll up into indeterminate parents.
When to use
Any hierarchical, nested structure the user needs to browse, expand, or select nodes from directly on the page.
Component Guide
Overview
Tree is a standalone, always-visible hierarchical structure with expandable branches - each node can be a folder-like parent with children or a leaf, optionally with a checkbox for multi-select. It's the always-on-page counterpart to Tree Select, which hides the same structure behind a dropdown trigger.
When to Use
- A file or folder browser - nested files and directories the user expands and browses directly.
- An org chart or category tree - a structure worth keeping visible while the user works, not hidden behind a click.
- A permission tree with checkboxes - selecting individual nodes or whole branches at once.
When Not to Use
- A form field that picks one value from hierarchical data - use Tree Select so the structure stays hidden until needed, saving space.
- Linked columns where each choice narrows the next - use Cascader instead of a single expandable tree.
- Flat, non-hierarchical data - use List or Table; a Tree's indentation and expand controls add nothing when there's no real nesting.
Best Practices
- Keep deeply nested branches collapsed by default, expanding only the path relevant to the current context.
- Use the Checkable type's parent-checkbox to reflect a partial (indeterminate) selection when only some children are checked.
- Pair folder/file icons with the indentation, not instead of it - icons alone don't communicate depth as clearly as indentation does.
- Reach for the Metatext type's second line of supplemental text to disambiguate similarly-named nodes or surface a quick detail (a file size, an item count) without adding a column.
Do and Don't
Do
Folders and files read differently at a glance, and the hierarchy is shown through real indentation, not just a label prefix.
Don't
A hyphen standing in for indentation collapses the moment there is more than one level deep, and gives folders no toggle to collapse their contents.
Accessibility
- Implemented with tree/treeitem roles, so screen readers announce each node's depth and expanded/collapsed state.
- Fully keyboard-operable - arrow keys move between nodes, and left/right expand or collapse a branch.
- Checkbox state (checked/indeterminate/unchecked) is exposed programmatically, not communicated by fill color alone.
Related Components
Tree Select, Cascader, Transfer.
{
"component": "Tree",
"status": "Experimental",
"category": "Data Display",
"summary": "Tree is a standalone, always-visible hierarchical structure with expandable branches - the always-on-page counterpart to Tree Select's dropdown-hidden variant.",
"whenToUse": [
"A file or folder browser with nested files and directories.",
"An org chart or category tree worth keeping visible while the user works.",
"A permission tree with checkboxes for selecting individual nodes or whole branches."
],
"whenNotToUse": [
"A form field that picks one value from hierarchical data - use Tree Select instead.",
"Linked columns where each choice narrows the next - use Cascader instead.",
"Flat, non-hierarchical data - use List or Table instead."
],
"bestPractices": [
"Keep deeply nested branches collapsed by default, expanding only the relevant path.",
"Use the Checkable type's parent-checkbox to reflect a partial (indeterminate) selection.",
"Pair folder/file icons with indentation, not instead of it.",
"Reach for the Metatext type's second line of supplemental text to disambiguate similarly-named nodes or surface a quick detail without adding a column."
],
"doAndDont": {
"do": "Folders and files read differently at a glance, and the hierarchy is shown through real indentation, not just a label prefix.",
"dont": "A hyphen standing in for indentation collapses the moment there is more than one level deep, and gives folders no toggle to collapse their contents."
},
"accessibility": [
"Implemented with tree/treeitem roles announcing depth and expanded state.",
"Fully keyboard-operable - arrow keys move between nodes, left/right expand or collapse.",
"Checkbox state is exposed programmatically, not communicated by color alone."
],
"relatedComponents": [
"Tree Select",
"Cascader",
"Transfer"
]
}