Skip to content

Tree ​

Nested details tree, role=tree

A hierarchy people expand and browse — files, a category tree, a table of contents. For a small chart of who reports to whom, OrgChart; to pick one value from a hierarchy, TreeSelect.

Basic
  • src
    • components
  • README.md
selected: index
  • One Tab stop: ↑ / ↓ move through the visible rows, → opens a branch or enters it, ← closes it or goes to the parent, Home / End jump. Enter picks the row (a branch too — Space opens and closes it). Branches say whether they're open.
  • Branches are native <details>, so they work before scripts run. href makes a leaf a link; v-model:selected holds the picked id.

Usage ​

ts
import { BlessTree, BlessTreeItem } from "blessing-ui";

API ​

BlessTree ​

Props

NameTypeDefaultDescription
nodes*BlessTreeNode[]—
labelstring"Tree"
selectedstring—

Events

NamePayloadDescription
select[node: BlessTreeNode, path: string]
update:selected[value: string | undefined]

BlessTreeItem ​

Props

NameTypeDefaultDescription
node*BlessTreeNode—
path*string—
selectedstring—
level*number—

Events

NamePayloadDescription
select[node: BlessTreeNode, path: string]

Released under the MIT License. Character names and artwork belong to their owners.