NVIDIA Elements Patterns Elements Foundations Integrations GitHub System Themes

Tree View

stable:  2.23.3 Coverage: 100.00% Bundle: 30.17kb Lighthouse: 100 Axe Core Released: 1.2.0
Overview API Examples
DefaultInvokerCommandsBorderSelectableSelectableMultipleSelectEventHighlightLinksAsyncPrefixSuffixNodeContentMaxWidthDynamicTreeOverflowBulkCreationAudit

Default

node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

A tree view widget presents a hierarchical list. Any item in the hierarchy may have child items, and items that have children can expand or collapse to show or hide the children.

Invoker Commands

Show details Hide details Details Model configuration Training results
Edit Example

Invoke commands from tree node titles to control another tree without event handlers. Click a title or press Enter on its header to open or close the target node.

Border

node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

Determines if the node depth border renders.

Border Description true false

Selectable

node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

Determines whether all nodes can be in a selected state. Nodes can be in a single or multi select state.

Selectable Description single multi

Selectable Multiple

node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

Multi-selection tree for choosing many items from hierarchical options, enabling bulk operations and comprehensive content management.

Select Event

test-case
Documents Annual Report.pdf Budget.xlsx Projects Project Alpha Project Beta Project Gamma Images photo-001.jpg photo-002.jpg screenshot.png

Selected: None

History:

  • No selections yet
Edit Example

Interactive selection handling using the select event, with callbacks for node selection changes.

Highlight

node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

Tree with highlighted nodes for emphasizing specific items, providing visual focus and search result signal in hierarchical data.

Edit Example

Tree with navigation links for hierarchical menu systems, enabling structured site navigation and content discovery.

Async

node 1 node 1-1 node 1-2 node 1-3
loading
node 2 node 2-1 node 2-2 node 2-3 node 3 node 3-1 node 3-2 node 3-3 node 3-3-1 node 3-3-2 node 3-3-3
Edit Example

Tree with loading states for asynchronous data, including progress indicators and dynamic content loading in hierarchical structures.

Prefix Suffix

test-case
src navigation controller.py planner.py
Edit Example

Tree with prefix and suffix content for each node, enabling flexible content organization and visual hierarchy.

Node Content

text content node link node link inline content
block

content

long form content interactive content

This is some longer content in a tree node.

hello there
input control
node content checkbox group node content radio group
Edit Example

Tree with rich node content including forms, controls, and interactive elements, enabling complex data management within hierarchical structures.

Max Width

test-case

1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890

Edit Example

Tree with a max width, ensuring the tree does not exceed the specified width.

Dynamic Tree

test-case
Edit Example

Dynamic tree with programmatic node creation and management, for scalable hierarchical data handling with large datasets.

Overflow

test-case
node 1 node 1-1 node 1-2 node 1-3 node 1-3-1 node 1-3-2 node 1-3-3 node 1-3-3-1 node 1-3-3-2 node 1-3-3-3 node 1-3-3-3-1 node 1-3-3-3-2 node 1-3-3-3-3 node 1-3-3-3-3-1 node 1-3-3-3-3-2 node 1-3-3-3-3-3 node 1-3-3-3-3-3-1 node 1-3-3-3-3-3-2 node 1-3-3-3-3-3-3 node 1-3-3-3-3-3-3-1 node 1-3-3-3-3-3-3-2 node 1-3-3-3-3-3-3-3 node 1-3-3-3-3-3-3-3-1 node 1-3-3-3-3-3-3-3-2 node 1-3-3-3-3-3-3-3-3 node 1-3-3-3-3-3-3-3-3-1 node 1-3-3-3-3-3-3-3-3-2 node 1-3-3-3-3-3-3-3-3-3 node 2 node 2-1 node 2-2 node 2-3
Edit Example

Tree with scrollable container for handling deep hierarchies and large datasets, ensuring optimal space usage and navigation.

Bulk Creation

test-caseperformance
Test
Edit Example

Tree with bulk node creation for performance testing, verifying efficient handling of large numbers of nodes and dynamic expansion.

Audit

anti-pattern
node
Edit Example

Examples of invalid tree usage patterns for testing and documentation purposes, showing what not to do when implementing trees.

Getting Started Overview Installation CLI MCP Skills Lint What’s New GitHub Patterns Overview Agent Authentication Browse Chat Code Dashboard Editor Empty States Heatmap Keyboard Shortcut Logging Media Navigation Onboarding Panel Responsive Search Subheader Trend Elements Overview Accordion Alert Avatar Badge Breadcrumb Button Button Group Card Chat Message Checkbox Codeblock Color Combobox Copy Button Datagrid Getting Started Integrations Column Action Column Alignment Column Fixed Column width Container Card Display Settings Footer Heatmap Keynav Multi Select Pagination Panel Detail Panel Grid Performance Placeholder Row Action Row Groups Row Sort Scroll Height Single Select Stripe Date Datetime Dialog Divider Dot Drag Handle Drawer Dropdown Dropdown Group Dropzone File Format Bytes Datetime Number Relative Time Truncate Forms Getting Started Validation Actions Control Gauge Ghost Icon Icon Button Iframe Input Input Group Joystick Logo Markdown Markdown CSS Media Controller Pause Button Playback Rate Select Loop Button Mute Button Media PiP Button Seek Button Time Range Volume Range Full-screen Button Menu Month Monaco Input Diff Input Monaco Editor Diff Editor Problems Notification Page Page Header Page Loader Pagination Progressive Filter Chip Progress Bar Progress Dot Progress Ring Password Preferences Input Pulse Radio Range Resize Handle Scroll Box Search Select Skeleton Sort Button Sparkline Star Rating Steps Switch Tabs Tag Textarea Time Toast Toggletip Toolbar Tooltip Tree Viewport Viewport Gridlines Minimap Zoom Range Week Workspace Foundations Overview Typography Iconography Themes Design Tokens Size & Space Objects Interactions Support Status Color Animation Fonts Layers Custom Layout Horizontal Vertical Grid Popovers i18n Visualization View Transitions DESIGN.md Integrations Getting Started Angular Bundles CDN Custom Elements Eleventy Golang HTMX + Go Hugo Import Maps Lit Lit Library MCP Apps NextJS Nuxt Pi Preact React SolidJS Sphinx Svelte TypeScript Vue About Changelog Metrics Support Accessibility Contributions Requests Migration Sitemap Labs Responsive Layout Viewport Container Patterns Forms Internal API Design Guidelines Properties & Attributes Slots Registration CustomEvents Stateless Composition Styles Packaging Glossary Logs Guidelines Agent Harness Agent Tooling Agent Ownership Documentation Examples TypeScript Testing Unit Testing Accessibility Testing Lighthouse Testing SSR Testing Visual Testing Troubleshooting Component Creation Examples All Examples