Data display

Tree

@xui/tree

A hierarchical tree with expand/collapse carets, single selection, optional icons and secondary labels. Full keyboard support: Up/Down move, Right/Left expand/collapse or step in/out, Enter/Space select. [(selectedId)] binding.

Install

pnpm add @xui/tree

Add the barrel to a standalone component's imports:

import { XuiTreeImports } from '@xui/tree';

@Component({
  imports: [XuiTreeImports],
  // …
})

Examples

Default

Loading preview…

API

XuiTree

componentxui-tree

A hierarchical tree of {@link XuiTreeNode}s with expand/collapse carets, single selection, optional icons and secondary labels, and full keyboard support (Up/Down move, Right/Left expand/collapse or step in/out, Enter/Space select).

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''ariaLabelstring | nullAccessible name for the tree — what it is a tree of.nullnodesXuiTreeNode[]The roots. Each node carries its own children, so the whole tree is one nested array.[]selectedIdtwo-waystring | number | nullThe selected node id. Two-way bindable with [(selectedId)].null

Outputs

NameTypenodeClickXuiTreeNodeEmits the node that was activated, by click or by Enter.nodeExpandedXuiTreeNodeEmits the node that was just expanded.nodeCollapsedXuiTreeNodeEmits the node that was just collapsed.

Source

libs/ui/tree/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.