Core Types
TreeItem<T>
The fundamental building block of the tree structure. Represents a single node in the tree.id- Unique identifier for the nodetitle- The main display content of the nodesubtitle- Secondary display contentexpanded- Whether the node’s children are visiblechildren- Array of child nodes
T- Custom properties to extend the tree item with your own data
NodeKey
The unique identifier type for tree nodes.NumberOrStringArray
Represents a path through the tree structure.TreeMap
A lookup map for quick node access by key.Function Types
OnChangeFn<T>
Callback triggered when tree data changes.GetNodeKeyFn<T>
Function to extract a unique key from a tree node.data.node- The tree nodedata.treeIndex- The node’s index in the flattened tree
GetFlatNodeKeyFn<T>
Function to extract a key from a node in flat data structures.GenerateNodePropsFn<T>
Function to generate dynamic props for each node.buttons- Array of React nodes to display as action buttonstitle- Function to render custom titlestyle- Custom CSS styles for the nodeclassName- Custom CSS class name
OnMoveNodeFn<T>
Callback when a node is moved via drag and drop.node- The moved nodetreeIndex- New index in the treepath- New path in the treetreeData- Updated tree dataprevTreeIndex- Previous indexprevPath- Previous pathnextTreeIndex- New index (same as treeIndex)nextPath- New path (same as path)nextParentNode- New parent node or null if root
OnVisibilityToggleFn<T>
Callback when a node is expanded or collapsed.treeData- Updated tree datanode- The toggled nodeexpanded- New expanded state
OnDragStateChangedFn<T>
Callback when drag state changes.isDragging- Whether any node is being draggeddraggedNode- The node being dragged
CanDragFn
Function or boolean to determine if a node can be dragged.CanDropFn<T>
Function to determine if a node can be dropped at a location.node- The node being droppedprevParent- Previous parent nodenextParent- Potential new parent nodeprevPath- Previous pathnextPath- Potential new path
CanNodeHaveChildrenFn<T>
Function to determine if a node can have children.SearchMethodFn<T>
Function to determine if a node matches a search query.node- The node to testpath- Node’s pathtreeIndex- Node’s indexsearchQuery- The search query
SearchFinishCallbackFn<T>
Callback when search completes.ShouldCopyOnOutsideDropFn<T>
Function or boolean to determine if dragging outside should copy instead of move.Configuration Types
MaxDepth
Maximum depth of the tree.RowDirection
Direction of text rendering.SearchQuery
Search query value.SearchFocusOffset
Index of the search result to focus on.OnlyExpandSearchedNodes
Whether only searched nodes should be expanded.DNDType
Custom drag and drop type identifier."REACT_APPLE_TREE_ITEM"
Classname
CSS class name.IsVirtualized
Whether the tree uses virtualization.true
Component Function Types
NodeRenderer<T>
Component type for rendering individual nodes.PlaceholderRenderer<T>
Component type for rendering drop placeholders.TreeRenderer<T>
Component type for rendering tree rows.Internal Types
FlatTreeItem
Internal representation of a node in the flattened tree.SearchedNodeMap
Map of node keys to their search match status.ContextProviderProps
Props for internal context providers.See Also
- Interfaces - Interface definitions
- Component Props - Main component props
- Utility Functions - Utility function types