Components · Forms · Tree Select
Back to Tree Select typesTree Select
Use for a select field over hierarchical, nested data - like an org chart or a folder structure - where the user can pick any node, parent or leaf, at any depth from an indented, expandable tree.
Properties
Size, corner radius, label and placeholder are properties of the same component, not separate fields - change them below to check this field's style and states in the Live Preview.
Live Preview
Both types compared side by side, each in all 10 states. One full matrix is rendered per selected combination of Size and Corner radius - check more than one option in a dropdown to see every combination side by side.
Multiple selection + Search
Two documented Ant TreeSelect features the matrix above can't show, since it's single-select with no search: typing narrows the tree to matching nodes (highlighted inline, ancestors kept visible for context), and a checkbox per node - parents included - lets more than one node be picked across different branches at once.
When to use
Any form field that needs to pick a single node from hierarchical, nested data, where the option set is too deep or too structured for a flat Select or Cascader's linked columns.
Validation
In checkbox mode, a parent node can show an indeterminate mark purely because some of its children are checked, without the parent itself being a selected value - required validation needs to look past that indeterminate state to whether any concrete node is actually checked.
- Required marking - the red asterisk sits on the field label, same as Select, independent of how many nodes end up checked.
- Validation timing - validate on blur (closing the tree panel with nothing checked) and again on submit.
- Error message - "Choose at least one option," not "This field is required" - specific enough to point back at the tree rather than the form in general.
- Recovery - an indeterminate-only state (a parent showing a dash because some, not all, descendants are checked, with no node explicitly checked by the user) does not satisfy a required rule on its own - require at least one concrete leaf or node to be explicitly checked, and reopen the tree with that branch expanded so the user can see why it's still flagged.
Component Guide
Overview
Tree Select is a select field over hierarchical, nested data - the user picks any node, parent or leaf, at any depth from an indented, expandable tree - used when the option set is too deep or too structured for a flat Select or Cascader's linked columns.
When to Use
- An org chart or folder-structure picker - where any level, not just leaves, is a valid selection.
- Permission group assignment - picking a specific nested group within a broader hierarchy.
- A nested tag selector or report hierarchy filter - where the full tree needs to stay visible and explorable at once.
When Not to Use
- A flat, non-nested option list - use Select - a tree adds visual complexity a flat list doesn't need.
- Data where only leaf nodes are ever valid, and the path itself matters more than seeing the whole tree at once - use Cascader's linked-column drill-down instead.
- A very large tree with thousands of nodes and no search - add a filter/search mode, or reconsider whether Tree Select is the right control for that scale.
Best Practices
- Let common branches start expanded when the selected value (or a sensible default) lives a level or two deep.
- Support typing to filter/search across the whole tree once it grows beyond a quick visual scan.
- Show the selected node's full path in the closed trigger, not just its own label, so the selection stays unambiguous.
Do and Don't
Do
The control shows the whole path, so "Icons" is never confused with another folder of the same name elsewhere in the tree.
Don't
Showing only the leaf name makes two different folders look like the same choice once the panel is closed.
Accessibility
- Implemented with tree/treeitem semantics, 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.
- The currently selected node is clearly announced, including which ancestor branch it belongs to.
Related Components
Select, Cascader, Transfer.
{
"component": "Tree Select",
"category": "Forms",
"summary": "Tree Select is a select field over hierarchical, nested data - the user picks any node, parent or leaf, at any depth from an indented, expandable tree - used when the option set is too deep or too structured for a flat Select or Cascader's linked columns.",
"whenToUse": [
"An org chart or folder-structure picker - where any level, not just leaves, is a valid selection.",
"Permission group assignment - picking a specific nested group within a broader hierarchy.",
"A nested tag selector or report hierarchy filter - where the full tree needs to stay visible and explorable at once."
],
"whenNotToUse": [
"A flat, non-nested option list - use Select - a tree adds visual complexity a flat list doesn't need.",
"Data where only leaf nodes are ever valid, and the path itself matters more than seeing the whole tree at once - use Cascader's linked-column drill-down instead.",
"A very large tree with thousands of nodes and no search - add a filter/search mode, or reconsider whether Tree Select is the right control for that scale."
],
"bestPractices": [
"Let common branches start expanded when the selected value (or a sensible default) lives a level or two deep.",
"Support typing to filter/search across the whole tree once it grows beyond a quick visual scan.",
"Show the selected node's full path in the closed trigger, not just its own label, so the selection stays unambiguous."
],
"doAndDont": {
"do": "The control shows the whole path, so \"Icons\" is never confused with another folder of the same name elsewhere in the tree.",
"dont": "Showing only the leaf name makes two different folders look like the same choice once the panel is closed."
},
"accessibility": [
"Implemented with tree/treeitem semantics, 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.",
"The currently selected node is clearly announced, including which ancestor branch it belongs to."
],
"relatedComponents": [
"Select",
"Cascader",
"Transfer"
]
}