Tree View

An expandable tree of rows, with selection.

Installation

bash
shellui-native add tree-view

Platforms: MAUI · Avalonia. Also installs icon, element-extensions.

Usage

Basic

Rendered with ShellUI for Blazor
<ui:TreeView SelectedValueChanged="OnFileSelected">
    <ui:TreeViewItem Text="src" Icon="Folder" IsExpanded="True">
        <ui:TreeViewItem Text="Components" Icon="Folder" IsExpanded="True">
            <ui:TreeViewItem Text="Button.cs" Icon="File" />
            <ui:TreeViewItem Text="Card.cs" Icon="File" />
        </ui:TreeViewItem>
        <ui:TreeViewItem Text="MainPage.xaml" Icon="FileText" />
    </ui:TreeViewItem>
    <ui:TreeViewItem Text="README.md" Icon="FileText" />
</ui:TreeView>
Avalonia, running in your browser

MAUI and Avalonia

Rows are tab stops on both platforms. On Avalonia, Right also expands a row and Left collapses it.

API

TreeView

XAML children go to Items.

Property Type Default Description
SelectedValue string — The selected item's Value (its Text when no Value is set).
Event Arguments Description
SelectedValueChanged string? User input only: setting SelectedValue from code or a binding doesn't raise it.

TreeViewItem

XAML children go to Items.

Property Type Default Description
Text string — Text shown by the component.
Value string — Identifies the item; reported as the tree's SelectedValue.
Icon IconName None Lucide icon from IconName; None for no icon.
IsExpanded bool false Whether the item's children are shown.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.