Skip to content

Tree

STree shows a hierarchy of nodes (a file tree, nested categories) with expandable branches and selection. It is fully keyboard operable (arrow keys navigate and expand, Enter/Space select), and Reka handles the tree/treeitem roles and focus. The data is a recursive items array; the selected node is available through v-model.

Basic usage

Node icons

The icon field of a node takes a name from the built-in registry (e.g. folder, file-text), so there is no need to store raw SVG paths.

Multiple selection

multiple allows selecting several nodes at once — v-model then holds an array of the selected nodes (select them by clicking or with Ctrl/Shift).

API

Props

NameTypeDefaultDescription
items*{ label: string; value?: string; icon?: string; children?: readonly }requiredHierarchical list of nodes.
multiplebooleanfalseAllows selecting multiple nodes.
default-expandedstring[]undefinedValues of the nodes expanded on first render.
model-value | { label: string; value?: string; icon?: string; children?: STreeItem[]; disabled?: boolean } | STreeItem[]undefinedSelected node (or array of nodes with multiple). Two-way bound via v-model.

Events

NameSignatureDescription
update:modelValue( value: | STreeItem | STreeItem[] | undefined ) => voidEmitted when modelValue changes. Used for two-way binding (v-model).