A high-performance React tree component with virtual scrolling, fuzzy search, multi-select, checkboxes, and full Tailwind CSS customization. Perfect for file explorers, navigation menus, and hierarchical data visualization.
Selected: None
Features custom expand/collapse icons with rounded style. Selected: None
This demo showcases the renderNode
feature which allows complete customization of node content while automatically maintaining proper indentation, tree lines, and interactive elements.
Selected: None
Customize tree appearance with treeLineClassName
and treeNodeClassName
props. Create themes, adjust colors, and style tree lines and nodes to match your design system.
treeLineClassName="border-blue-400 border-dashed"
treeLineClassName="border-dotted border-2"
Selected: None
Checked: None
⚡ This tree demonstrates virtualization for large datasets (500+ items) and fuzzy search functionality. The tree automatically expands to show search results and highlights matching text.
npm install rstree-ui react react-dom
npm install tailwindcss # Optional for styling
Three styling options available:
@import "tailwindcss";
@source "../node_modules/rstree-ui";
// tailwind.config.js
content: ["./node_modules/rstree-ui/**/*.{js,ts,jsx,tsx}"]
import 'rstree-ui/style.css'
import { RsTree } from 'rstree-ui'
import { useState } from 'react'
const data = [
{
id: '1',
label: 'Documents',
children: [
{ id: '1-1', label: 'Resume.pdf' },
{ id: '1-2', label: 'Project.zip' }
]
},
{ id: '2', label: 'Pictures' }
]
function App() {
const [selectedIds, setSelectedIds] = useState([])
const [searchTerm, setSearchTerm] = useState('')
return (
<div>
<input
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
placeholder="Search..."
/>
<RsTree
data={data}
selectedIds={selectedIds}
onSelect={setSelectedIds}
searchTerm={searchTerm}
showIcons={true}
virtualizeEnabled={true}
multiSelect={true}
checkable={true}
/>
</div>
)
}