Skip to content

TreeTable ​

Expandable rows on BlessTable

Rows that nest — a folder listing with sizes, a budget with sub-items — shown as a table with expandable rows. For a hierarchy without columns, use Tree.

It renders through Table, so columns, striping, row headers and cell slots all work the same. For a flat table, Table or DataTable.

Basic
NameKindSize
srcdir48 KB
componentsdir40 KB
index.tsfile8 KB
docsdir120 KB
README.mdfile12 KB
expanded: [ "src" ]
  • The tree column (treeColumn, first by default) carries the indent and a toggle named by the row's value, which says whether it's open.
  • v-model:expanded (or defaultExpanded) holds the open row ids; childrenKey names the children field.

Usage ​

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

API ​

Props

NameTypeDefaultDescription
columns*BlessColumn<T>[]—
rows*T[]—rows with an optional `children` array of the same shape
rowKey*keyof T & string—
childrenKeystring"children"
treeColumn(keyof T & string)—column that carries the indent + toggle; default: first
captionstring—
stripedboolean—
defaultExpanded(string | number)[][]ids expanded initially
expandedId[]—

Events

NamePayloadDescription
update:expanded[value: Id[] | undefined]

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