1. framework components
  2. tree view

Tree View

Used to display hierarchical data.

File System

package.json

Controlled

Reactively set and control the state values.

File System

package.json

Multiple Selection

  • Windows: Hold Ctrl + left click with mouse.
  • MacOS: Hold + left click with mouse.

File System

package.json

Provider Pattern

Use the Provider Pattern to gain access to the collapse and expand methods on the TreeView instance.

File System

package.json

Lazy Loading

Utilize promises to asynchronously load large node lists.

File System

package.json

Anatomy

Here’s an overview of how the TreeView component is structured in code:

tsx
import { TreeView } from '@skeletonlabs/skeleton-react';

export default function Anatomy() {
	return (
		<TreeView>
			<TreeView.Label />
			<TreeView.Tree>
				<TreeView.Branch>
					<TreeView.BranchControl>
						<TreeView.BranchTrigger />
						<TreeView.BranchIndicator />
						<TreeView.BranchText />
					</TreeView.BranchControl>
					<TreeView.BranchContent>
						<TreeView.Item>
							<TreeView.ItemText />
						</TreeView.Item>
					</TreeView.BranchContent>
				</TreeView.Branch>
			</TreeView.Tree>
		</TreeView>
	);
}

API Reference

Unable to load component information for react/tree-view

View page on GitHub