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
Pick a file
src
components
docs
index.ts
src
components
docs
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.
multipleshows picks as chips. Toggle a row again to remove it, or press Backspace on the field to remove the last one.leafOnlyallows only rows without children. Inside a Field the field's label names it.
Usage
ts
import { BlessTreeSelect } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | — | |
nodes* | BlessTreeNode[] | — | |
multiple | boolean | — | |
placeholder | string | "Select…" | |
leafOnly | boolean | false | only leaves (no children) can be picked |
disabled | boolean | — | |
invalid | boolean | — | |
label | string | — | accessible name when there's no Field; also names the tree |
size | "md" | "sm" | "lg" | "md" | |
modelValue | string | string[] | — | node id (or path) — string[] when multiple |
Events
| Name | Payload | Description |
|---|---|---|
select | [node: BlessTreeNode, id: string] | |
update:modelValue | [value: string | string[] | undefined] |