Tree
@rockshin/tao-uiHierarchical data with selection, checkboxes, async children, dragging and virtual scrolling.
Each example can be copied and run independently. Use the device control on framed previews to switch between desktop and phone widths.
Examples
Expand and select
Use stable keys for nodes. Arrow keys navigate the tree; Enter selects the active node.
Controlled checks
Checking a parent includes its enabled descendants. Keep the returned keys in state.
Independent and disabled checks
checkStrictly separates parent and child checks. disabled and disableCheckbox have different scopes.
Directory tree
DirectoryTree adds folder/file icons and familiar range or modifier-key selection when multiple is enabled.
Custom titles and semantics
titleRender decorates content without changing node keys. Semantic styles target the real title slot.
Load children on demand
This local example simulates a delayed result. Resolve loadData after updating the parent node.
Virtual list and scrollTo
A bounded height enables virtual rendering. The ref scrolls to a key even when its row is outside the viewport.
Reorder a flat tree
This example allows drops between rows and stores the new order. Nested moves can use the same onDrop contract.
Tree in a narrow pane
Use the phone preview to expand and check nodes within a bounded scroller.
API
BasicDataNode
For fieldNames, we provides a abstract interface