Tree View
StableA hierarchical list component for displaying nested structures like file systems.
Examples
Basic Usage
src
components
button.tsx
input.tsx
assets
index.ts
package.json
tsx
<TreeView
data={treeData}
defaultExpandedIds={['src', 'components']}
defaultSelectedId="button.tsx"
/>Neon Variant
src
components
assets
index.ts
package.json
tsx
<TreeView variant="neon" data={treeData} />API Reference
| Property | Description | Type | Default |
|---|---|---|---|
| data | Array of TreeDataItem objects representing the hierarchy. | TreeDataItem[] | - |
| variant | Visual style for the tree view. | "default" | "neon" | "glass" | - |
| defaultExpandedIds | List of node IDs that should be expanded initially. | string[] | - |
| defaultSelectedId | ID of the node that should be selected initially. | string | - |
| onNodeSelect | Callback fired when a node is clicked. | (node: TreeDataItem) => void | - |