Reference
Tree View
TreeView, dressed in the paper-and-ink system: quiet rows where selection is pure light on the paper, one hairline plumb line per depth, and branches that swing open on the spring. The parts — Root, Label, Tree, NodeProvider, NodeContext, Branch, BranchControl, BranchTrigger, BranchIndicator, BranchText, BranchContent, BranchIndentGuide, Item, ItemText, ItemIndicator, NodeCheckbox, NodeRenameInput, plus createTreeCollection.
Branch · BranchContent · BranchControl · BranchIndentGuide · BranchIndicator · BranchText · BranchTrigger · Item · ItemIndicator · ItemText · Label · NodeCheckbox · NodeRenameInput · Root · Tree
#BranchContent
A styled part — no props of its own; it takes the anatomy's shared styling.
#BranchControl
A styled part — no props of its own; it takes the anatomy's shared styling.
#BranchIndentGuide
A styled part — no props of its own; it takes the anatomy's shared styling.
#BranchIndicator
A styled part — no props of its own; it takes the anatomy's shared styling.
#BranchText
A styled part — no props of its own; it takes the anatomy's shared styling.
#BranchTrigger
A styled part — no props of its own; it takes the anatomy's shared styling.
#Branch
A styled part — no props of its own; it takes the anatomy's shared styling.
#ItemIndicator
A styled part — no props of its own; it takes the anatomy's shared styling.
#ItemText
A styled part — no props of its own; it takes the anatomy's shared styling.
#Item
A styled part — no props of its own; it takes the anatomy's shared styling.
#Label
A styled part — no props of its own; it takes the anatomy's shared styling.
#NodeCheckboxIndicator
| Prop | Type | Default | Description |
|---|---|---|---|
fallback | unknown | — | |
indeterminate | unknown | — |
#NodeCheckbox
A styled part — no props of its own; it takes the anatomy's shared styling.
#NodeContext
A styled part — no props of its own; it takes the anatomy's shared styling.
#NodeProvider
| Prop | Type | Default | Description |
|---|---|---|---|
indexPath | number[] | The index path of the tree node | |
node | TreeNode | The tree node | |
node | T | — |
#NodeRenameInput
A styled part — no props of its own; it takes the anatomy's shared styling.
#Root
| Prop | Type | Default | Description |
|---|---|---|---|
size | String as PropType<"sm" | "md" | "lg"> | "md" | One rung of the row register: the rows' breathing room follows it. |
canRename | (node: T, indexPath: number[]) => boolean | Function to determine if a node can be renamed | |
checkedValue | string[] | The controlled checked node values | |
collection | TreeCollection<T> | The collection of tree nodes | |
defaultCheckedValue | string[] | The initial checked node values when rendered. Use when you don't need to control the checked node values. | |
defaultExpandedValue | string[] | The initial expanded node values when rendered. Use when you don't need to control the expanded node values. | |
defaultFocusedValue | string | The initial focused node value when rendered. Use when you don't need to control the focused node value. | |
defaultSelectedValue | string[] | The initial selected node values when rendered. Use when you don't need to control the selected node values. | |
expandedValue | string[] | The controlled expanded node values | |
expandOnClick | boolean | true | Whether clicking on a branch should open it or not |
focusedValue | string | The id of the focused node | |
id | string | The unique identifier of the machine. | |
ids | Partial<{ root: string; tree: string; label: string; node(value: string): string; }> | The ids of the tree elements. Useful for composition. | |
loadChildren | (details: treeView.LoadChildrenDetails<T>) => Promise<T[]> | A function that loads the children of a node. | |
selectedValue | string[] | The controlled selected node values | |
selectionMode | 'single' | 'multiple' | "single" | Whether the tree supports multiple selection - "single": only one node can be selected - "multiple": multiple nodes can be selected |
translations | treeView.IntlTranslations | Specifies the localized strings that identifies the accessibility elements and their states | |
typeahead | boolean | true | Whether the tree supports typeahead search |
| Event | Payload |
|---|---|
focusChange | details: FocusChangeDetails<any> |
checkedChange | details: CheckedChangeDetails |
update:focusedValue | value: string | null |
expandedChange | details: ExpandedChangeDetails<any> |
selectionChange | details: SelectionChangeDetails<any> |
loadChildrenComplete | details: LoadChildrenCompleteDetails<T> |
loadChildrenError | details: LoadChildrenErrorDetails<T> |
renameStart | details: RenameStartDetails<T> |
beforeRename | details: RenameCompleteDetails |
renameComplete | details: RenameCompleteDetails |
update:expandedValue | value: string[] |
update:selectedValue | value: string[] |
update:checkedValue | value: string[] |
#Tree
A styled part — no props of its own; it takes the anatomy's shared styling.