Tree — Playground

Switch between display and checkable modes while preserving controlled state.

px
app
app.routes.ts
docs
tree.md
archive
mode
size
State
html.html
<kui-tree ariaLabel="Project files" [data]="nodes" [loadChildren]="loadChildren" [(value)]="selectedId" [(expandedIds)]="expandedIds" />
NameTypeDefaultDescription
mode'display' | 'checkable' | undefinedundefinedSelects navigation-style rows or checkbox rows with cascade. Falls back to defaults.tree.mode, then display.
size'xs' | 'sm' | 'md' | 'lg' | undefinedundefinedControls row height and label scale; only sm, md and lg have dedicated styling. Falls back to defaults.tree.size, then the root size, then md.
datareadonly KuiTreeNode[][]Root nodes rendered by the tree.
ariaLabelstring | undefinedundefinedAccessible name for the role="tree" container. Falls back to the tree.label message (Tree).
mobilebooleanfalseIncreases toggle hit targets to support touch layouts.
[(value)]string | nullnullControlled selected node id in display mode.
[(selected)]string | nullnullDeprecated alias for value, kept in sync with it. Use value instead; planned for removal in the next major version.
[(checkedIds)]string[][]Controlled checked node ids in checkable mode.
[(expandedIds)]string[][]Controlled expanded node ids.
loadChildren(node: KuiTreeNode) => Promise<readonly KuiTreeNode[]>-Lazy child loader called once for nodes marked lazy.
KuiTreeNode.icon'folder' | 'file'-Optional built-in glyph. Custom icon templates are not implemented.
KuiTreeOptionsinterface-Shape of defaults.tree: size, mode and disclosureIcon.

Inputs verified against @kikita-labs/ui v2.0.0 public typings and package docs.