/syncfusion-blazor:syncfusion-blazor-treeviewfrom Syncfusion Blazor Components
Implement Syncfusion Blazor TreeView component for hierarchical data display with single/multi-selection, editing, expand-collapse, checkboxes, drag-drop, and virtualization. Use this skill whenever the user needs to display tree-structured data, enable node selection and editing, implement checkboxes for multi-selection, load data on demand, filter and search nodes, customize node appearance, or handle tree interaction events.
Ships in Syncfusion Blazor Components. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Blazor TreeView component displays hierarchical data in an expandable/collapsible tree structure. It supports local and remote data binding, single and multi-selection, editing, checkboxes, drag-drop reordering, virtualization for large datasets, filtering, and comprehensive event handling.
Use the TreeView component when you need to:
Install Syncfusion NuGet packages and configure your Blazor project:
// 1. Install NuGet packages
// Install-Package Syncfusion.Blazor.Navigations -Version 26.1.35
// Install-Package Syncfusion.Blazor.Themes -Version 26.1.35
// 2. Add to _Imports.razor
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Navigations
// 3. Register service in Program.cs
builder.Services.AddSyncfusionBlazor();
// 4. Add CSS theme to Index.html or _Layout.cshtml
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
@using Syncfusion.Blazor.Navigations
<SfTreeView TValue="MailItem">
<TreeViewFieldsSettings TValue="MailItem"
Id="Id"
Text="FolderName"
Child="Children"
DataSource="@MyFolder">
</TreeViewFieldsSettings>
<TreeViewEvents TValue="MailItem" NodeSelected="OnNodeSelected"></TreeViewEvents>
</SfTreeView>
@code {
public class MailItem
{
public string? Id { get; set; }
public string? FolderName { get; set; }
public List<MailItem>? Children { get; set; }
}
void OnNodeSelected(NodeSelectEventArgs args)
{
Console.WriteLine($"Selected: {args.NodeData.Text}");
}
List<MailItem> MyFolder = new()
{
new MailItem { Id = "1", FolderName = "Inbox", Children = new() },
new MailItem { Id = "2", FolderName = "Sent", Children = new() }
};
}
| Property | Type | Default | Purpose |
|---|---|---|---|
AllowDragAndDrop | bool | false | Enable/disable drag-drop hierarchy reordering |
AllowEditing | bool | false | Allow double-click node renaming |
AllowMultiSelection | bool | false | Enable Ctrl+Click multi-selection |
ShowCheckBox | bool | false | Display checkboxes for each node |
AutoCheck | bool | true | Auto-check/uncheck children when parent checked |
EnablePersistence | bool | false | Persist expanded/selected/checked state to localStorage |
EnableVirtualization | bool | false | Virtual scrolling for 1000+ nodes (requires Height) |
ExpandedNodes | string[] | Empty | Initially expanded node IDs (2-way bindable) |
SelectedNodes | string[] | Empty | Selected node IDs (2-way bindable) |
CheckedNodes | string[] | Empty | Checked node IDs (2-way bindable) |
LoadOnDemand | bool | true | Load children only when node expands |
ExpandOn | ExpandAction | Click | Trigger expand on Click/DoubleClick/None |
Height | string | "auto" | Fixed height (required for virtualization) |
| Method | Purpose |
|---|---|
ExpandAllAsync() | Expand all nodes |
ExpandAllAsync(string[] nodeIds) | Expand specific nodes by ID |
CollapseAllAsync() | Collapse all nodes |
CollapseAllAsync(string[] nodeIds) | Collapse specific nodes |
BeginEditAsync(string nodeId) | Enter edit mode for a node |
GetTreeData() | Get all tree data |
GetTreeData(string nodeId) | Get specific node data by ID |
EnsureVisibleAsync(string nodeId) | Scroll to make node visible |
CheckAllAsync() | Check all checkboxes |
UncheckAllAsync() | Uncheck all checkboxes |
ClearStateAsync() | Clear all state (selection, expand, check) |
| Event | Fires When | Common Uses |
|---|---|---|
Created | TreeView initialized | Post-initialization setup, load preferences |
DataBound | Data binding complete | Auto-expand default nodes, validate data |
NodeSelected | Node left-clicked | Load node details, enable actions |
NodeClicked | Node clicked | Distinguish single vs double-click |
NodeExpanded | Node expanded | Load child nodes (load-on-demand) |
NodeCollapsed | Node collapsed | Optional: Unload children from memory |
NodeEditing | Before edit mode | Validate permissions, prevent edits |
NodeEdited | Edit confirmed | Validate new text, save to server |
OnNodeDragStart | Drag begins | Prevent dragging restricted nodes |
NodeDropped | Drop completed | Update hierarchy in server |
NodeChecking | Before checkbox changes | Prevent checking restricted nodes |
NodeChecked | Checkbox changed | Update related data, trigger actions |
DataSourceChanged | Data source updated | Re-apply filters, refresh calculations |
OnActionFailure | Action fails (API error) | Recover from errors, show notifications |
OnKeyPress | Key pressed | Implement keyboard shortcuts (Delete, F2, etc) |
<SfTreeView TValue="Item" @bind-SelectedNodes="@SelectedIds">
<TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
<TreeViewEvents TValue="Item" NodeSelected="OnSelect"></TreeViewEvents>
</SfTreeView>
@code {
string[] SelectedIds = Array.Empty<string>();
void OnSelect(NodeSelectEventArgs args) => Console.WriteLine(args.NodeData.Text);
}
<SfTreeView TValue="Item" AllowMultiSelection="true" @bind-SelectedNodes="@SelectedIds">
<TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
</SfTreeView>
void OnNodeExpanded(NodeExpandEventArgs args)
{
if (args.NodeData.HasChild && args.NodeData.Child == null)
{
// Load children from API
args.NodeData.Child = await FetchChildren(args.NodeData.Id);
}
}
<SfTreeView TValue="Item" AllowDragAndDrop="true">
<TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
<TreeViewEvents TValue="Item" NodeDropped="OnDropped"></TreeViewEvents>
</SfTreeView>
void OnDropped(DragAndDropEventArgs args) => UpdateHierarchy(args);
<SfTreeView TValue="Item" AllowEditing="true" DoubleClickAction="DoubleClickAction.Edit">
<TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
<TreeViewEvents TValue="Item" NodeEdited="OnEdited"></TreeViewEvents>
</SfTreeView>
void OnEdited(NodeEditEventArgs args) => SaveChanges(args.NodeData);
<SfTreeView TValue="Item" AllowCheckBoxes="true" ChildChecking="ChildCheckState.Both">
<TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
</SfTreeView>
var checked = treeRef.GetAllCheckedNodes();
📄 Read: references/getting-started.md
📄 Read: references/data-binding.md
📄 Read: references/node-selection.md
📄 Read: references/expand-collapse-actions.md
📄 Read: references/node-editing.md
📄 Read: references/checkbox-features.md
📄 Read: references/events-handling.md
📄 Read: references/advanced-features.md
📄 Read: references/customization-styling.md
📄 Read: references/authorization-authentication.md
📄 Read: references/navigation-patterns.md
Need help? Start with:
Real-world implementations:
This skill provides comprehensive guidance for implementing the Syncfusion Blazor TreeView component. Use the Documentation and Navigation Guide section above to find the specific reference file you need based on your use case.
references/advanced-features.md (opens in a new tab)references/authorization-authentication.md (opens in a new tab)references/checkbox-features.md (opens in a new tab)references/customization-styling.md (opens in a new tab)references/data-binding.md (opens in a new tab)references/events-handling.md (opens in a new tab)references/expand-collapse-actions.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/navigation-patterns.md (opens in a new tab)references/node-editing.md (opens in a new tab)references/node-selection.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-blazor69 skills in this plugin
/syncfusion-blazor-3d-chartsProvides guidance for building and customizing Syncfusion Blazor 3D Charts. Trigger this skill whenever the user needs help with SfChart3D, 3D Column/Bar charts, axes, data binding, rotation, tilt, depth, legends, tooltips, or any configuration in Syncfusion.Blazor.Chart3D./syncfusion-blazor-accordionGuide for implementing the Syncfusion Blazor Accordion component for creating collapsible panels with expandable content. Use this skill when users need to build accordions, implement collapsible sections, create expandable panels, organize content in navigation components, implement FAQs, build collapsible menus, add nested accordions, configure expand modes (single or multiple), handle accordion events, customize accordion styling, implement accessible accordions with WCAG compliance, integrate data binding, or work with any vertically collapsible content containers in Blazor applications./syncfusion-blazor-accumulation-chartImplement Syncfusion Blazor Accumulation Chart (SfAccumulationChart) for proportional data visualization. Use this when creating pie charts, doughnut charts, funnel charts, or pyramid charts. This skill covers data labels, legends, tooltips, slice grouping, and part-to-whole visualizations in Blazor applications.Other plugins' skills for the same job