TreeItem
<ts-tree-item> vv0.4.0
The ts-tree-item component.
Open in Storybook for interactive demos.
Preview
Section titled “Preview”<ts-tree-item>Content</ts-tree-item>Properties
Section titled “Properties”| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
disabled | disabled | boolean | false | Whether the item is disabled. |
expanded | expanded | boolean | false | Whether the item is expanded (has children). |
icon | icon | string | undefined | — | Optional Lucide icon name. |
label | label | string | undefined | — | The item label. |
selected | selected | boolean | false | Whether the item is selected. |
Events
Section titled “Events”| Event | Detail | Bubbles | Composed | Description |
|---|---|---|---|---|
tsSelect | { selected: boolean; value: string; } | Yes | Yes | Emitted when the item is selected. |
tsToggle | { expanded: boolean; } | Yes | Yes | Emitted when expand/collapse is toggled. |
| Name | Description |
|---|---|
*(default)* | Default slot for nested ts-tree-item children. |
label | Custom label content. |
CSS Parts
Section titled “CSS Parts”Use ::part() to style internal elements:
| Part | Description |
|---|---|
base | The tree item container. |
chevron | The expand/collapse chevron. |
icon | The icon wrapper. |
label | The 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>