Tree
Description
A component that displays a hierarchical list
A tree displays hierarchical data. Nodes can be expanded or collapsed to reveal nested data.
Supports synchronous and asynchronous loading of child nodes.
API reference
public sealed class Tree : ComponentBase<Tree, HTMLUListElement>, IContainer<Tree.Item, Tree.Item>A vertically-stacked tree view with expand / collapse, keyboard navigation, selection and arbitrary item rendering.
Properties
Methods
public Tree OnSelected(ComponentEventHandler<Tree, Item> onSelected)Registers a callback invoked when the selected event fires.
public Tree SelectionEnabled(bool enabled = true)Enables or disables item selection on the tree.
public void Replace(Item newComponent, Item oldComponent)Replaces an existing item with a new one.
Samples
Basic Synchronous Tree
Asynchronous Tree
Selectable Tree
File-System Tree with Selection Events
This sample models a realistic project layout. OnSelected on the Tree fires every time the user clicks an item, so we mirror the path of the selected node in a panel beside the tree.