Default Light
MgLibrary
Overview
Installation
Buttons
Cards
Charts
Codes
Data Grids
Dropdowns
Editors
Headers & Animations
Icons
Indicators
Inputs
Lists
Modals
Menus
Panels
Pills & Chips
Scheduling
Tabs
Time Line
Trees
Customization

Trees

Hierarchical data visualization components for representing nested structures like file systems, categories, or navigation menus.

Use this example to explore default behavior, customization points, and accessibility-friendly patterns in a real Blazor page.

Standard Tree

MgTreeContainer

A flexible tree component that supports infinite nesting, custom icons, and optional checkboxes for multi-selection.

Tree Navigation

NavTo

You can use the tree as a navigation menu by providing the NavTo property to any MgTreeItem.

API Reference

MgTreeContainer

Property Type Default Description
ShowCheckBoxes bool false Whether to show checkboxes for selection.
ItemSelected EventCallback<MgTreeItem> - Triggered when an item is selected.
CheckChanged EventCallback<List<MgTreeItem>> - Triggered when checkbox states change.

MgTreeItem

Property Type Default Description
DisplayText string "" The text to display for the item.
IconName string null Optional icon for the item.
An unhandled error has occurred. Reload 🗙