Zephora UI

Data

TreeTable

Hierarchical table (treegrid): rows nest via children, the first column indents by depth and carries an expand/collapse toggle.

Import

import { TreeTable } from "@zephora/react";

Examples

Basic

NameKindSize
srcFolder44 KB
index.tsFile1 KB
LICENSEFile2 KB

Controlled expansion

Drive `expandedKeys` yourself to build expand-all / collapse-all actions.

NameKindSize
LICENSEFile2 KB

API

TreeTable props

PropTypeDefaultDescription
columns *TreeTableColumn[]Column definitions.
data *TreeTableRow[]Root rows; nesting comes from each row's `children`.
expandedKeysstring[]Controlled expanded row keys.
defaultExpandedKeysstring[][]Uncontrolled initial expanded row keys.
onExpandedChange(keys: string[]) => voidFires with the full set of expanded keys.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

TreeTableColumn props

PropTypeDefaultDescription
key *stringUnique column id, matched against `row.cells`.
header *ReactNodeHeader cell content.
widthnumber | stringFixed column inline-size.
align"start" | "center" | "end"Cell text alignment.

TreeTableRow props

PropTypeDefaultDescription
key *stringUnique row key.
cells *Record<string, ReactNode>Cell content per column key.
childrenTreeTableRow[]Nested rows; presence adds the expand/collapse toggle.