• Docs
  • Components
  • Blocks
  • Admin
CtrlK
Get Started
  • Introduction
  • Setup
  • CLI
  • VS Code Extension
  • Figma Code Connect
  • MCP Server
  • llms.txt
  • Changelog
Foundations
  • Design Tokens
  • Theming & Modes
  • Semantic Colors
  • Spacing
  • Typography
Testing
  • Test Guide
  • Performance Tests
  • Visual Regression
Components
  • Accordion
  • Activity Feed
  • Alert
  • Avatar
  • Badge
  • Breadcrumbs
  • Button
  • Card
  • Carousel
  • Checkbox
  • Collapsible
  • Combobox
  • Command Palette
  • Context Menu
  • Date Picker
  • Dialog
  • Dropdown Menu
  • File Upload
  • Hover Card
  • Input
  • Kbd
  • Label
  • Menubar
  • Metric Card
  • Multi Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Quick Actions
  • Radio
  • Rating
  • Resizable
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Skeleton
  • Slider
  • Spinner
  • Split Button
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree View
Blocks
  • Activity Feed
  • App Shell
  • Authentication Block
  • Benefits Section
  • Cta Section
  • Data Table
  • Empty State
  • Faq Section
  • Feature Grid Section
  • Footer Section
  • Hero Section
  • Kpi Dashboard
  • Kpi Strip
  • Link Card
  • Metric Card
  • Navigation Header
  • Pagination Footer
  • Pricing Table
  • Quick Actions
  • Settings Screen
Resources
  • API Reference
TooltipActivity Feed
TooltipActivity Feed
TooltipActivity Feed

Tree View

Explore hierarchical data with expandable nodes.

Example

Documents
Reports
Invoices
Images
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Install

API Reference

PropTypeDefaultDescription
nodes?TreeNode[][]Array of TreeNode objects representing the tree structure (optional)
selectedIds?string[][]Array of selected node IDs (optional)
expandedIds?string[][]Array of expanded node IDs (optional)
onSelectionChange?(selectedIds: string[]) => void—Callback when selection changes (optional)
onExpansionChange?(expandedIds: string[]) => void—Callback when expansion changes (optional)
showCheckboxes?booleanfalseShow checkboxes for selection (optional)
showIcons?booleantrueShow default folder/file icons (optional)
defaultExpanded?booleanfalseExpand all nodes by default (optional)
onNodeClick?(node: TreeNode) => void—Callback when a node is clicked (optional)
onNodeDoubleClick?(node: TreeNode) => void—Callback when a node is double-clicked (optional)
renderNodeActions?(node: TreeNode) => ReactNode—Function to render custom actions for each node (optional)
indentSize?number20Pixel indentation per level (optional)
className?string—Additional CSS classes (optional)

TreeNode interface:

  • id – string. Unique identifier (required)
  • label – string | ReactNode. Node label text or React node (required)
  • children? – TreeNode[]. Array of child TreeNode objects (optional)
  • icon? – ReactNode | function. Custom icon or function returning icon: (isSelected: boolean) => ReactNode (optional)
  • disabled? – boolean. Disable node interaction (optional)
  • alwaysExpanded? – boolean. Keep node always expanded (optional)
  • hideChevron? – boolean. Hide expand/collapse chevron (optional)
  • data? – object. Additional data for drag & drop, context menu, etc. (optional)
  • className? – string. Additional CSS classes for the node (optional)