Skip to content

TreeItem

<ts-tree-item> vv0.4.0

The ts-tree-item component.

Open in Storybook for interactive demos.

<ts-tree-item>Content</ts-tree-item>
PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalseWhether the item is disabled.
expandedexpandedbooleanfalseWhether the item is expanded (has children).
iconiconstring | undefinedOptional Lucide icon name.
labellabelstring | undefinedThe item label.
selectedselectedbooleanfalseWhether the item is selected.
EventDetailBubblesComposedDescription
tsSelect{ selected: boolean; value: string; }YesYesEmitted when the item is selected.
tsToggle{ expanded: boolean; }YesYesEmitted when expand/collapse is toggled.
NameDescription
*(default)*Default slot for nested ts-tree-item children.
labelCustom label content.

Use ::part() to style internal elements:

PartDescription
baseThe tree item container.
chevronThe expand/collapse chevron.
iconThe icon wrapper.
labelThe label wrapper.
ts-tree-item::part(base) {
/* your custom styles */
}
<ts-tree-item>Content</ts-tree-item>
import { TsTreeItem } from '@tessera-ui/react';
<TsTreeItem>Content</TsTreeItem>