Skip to content

TreeSelect ​

Tree in a popover, single or multiple

A choice from a hierarchy — a folder, a category under a category, a team inside a department. For a flat list use Select; for a few levels of dependent choice where each level is its own list, CascadeSelect.

Basic
—
[ "index" ]

Not inside <p>

The floating panel is a <div>. HTML closes a <p> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.

  • Enter, Space or ↓ opens it and focus moves into the tree (onto the picked row); the tree's own arrow keys take over from there.
  • multiple shows picks as chips. Toggle a row again to remove it, or press Backspace on the field to remove the last one.
  • leafOnly allows only rows without children. Inside a Field the field's label names it.

Usage ​

ts
import { BlessTreeSelect } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
idstring—
nodes*BlessTreeNode[]—
multipleboolean—
placeholderstring"Select…"
leafOnlybooleanfalseonly leaves (no children) can be picked
disabledboolean—
invalidboolean—
labelstring—accessible name when there's no Field; also names the tree
size"md" | "sm" | "lg""md"
modelValuestring | string[]—node id (or path) — string[] when multiple

Events

NamePayloadDescription
select[node: BlessTreeNode, id: string]
update:modelValue[value: string | string[] | undefined]

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