Component

BOBTreeMenu

Hierarchical navigation with icons, nested groups, vertical or horizontal orientation, and hover or click triggers.

API reference ↗

Basic usage

Declare BOBTreeMenuItems — nest them via ChildContent.

RAZOR
<BOBTreeMenu TItem="object" Size="BOBSize.Medium">
    <BOBTreeMenuItem Text="Dashboard" Icon="@BOBIconKeys.UI.Home" />
    <BOBTreeMenuItem Text="Projects" Icon="@BOBIconKeys.UI.Folder" InitiallyExpanded="true">
        <ChildContent>
            <BOBTreeMenuItem Text="Active" />
            <BOBTreeMenuItem Text="Archived" />
            <BOBTreeMenuItem Text="Templates">
                <ChildContent>
                    <BOBTreeMenuItem Text="Blank" />
                    <BOBTreeMenuItem Text="Starter" />
                </ChildContent>
            </BOBTreeMenuItem>
        </ChildContent>
    </BOBTreeMenuItem>
    <BOBTreeMenuItem Text="Team" Icon="@BOBIconKeys.UI.Settings" />
</BOBTreeMenu>

Horizontal (top bar)

RAZOR
<BOBTreeMenu TItem="object"
             Orientation="TreeMenuOrientation.Horizontal"
             ExpandMode="TreeMenuExpandMode.Flyout"
             Trigger="TreeMenuTrigger.Hover">
    <BOBTreeMenuItem Text="File">
        <ChildContent>
            <BOBTreeMenuItem Text="New" />
            <BOBTreeMenuItem Text="Open" />
            <BOBTreeMenuItem Text="Save" />
        </ChildContent>
    </BOBTreeMenuItem>
    <BOBTreeMenuItem Text="Edit">
        <ChildContent>
            <BOBTreeMenuItem Text="Undo" />
            <BOBTreeMenuItem Text="Redo" />
        </ChildContent>
    </BOBTreeMenuItem>
    <BOBTreeMenuItem Text="Help" />
</BOBTreeMenu>

Hover trigger

Open submenus on hover instead of click.

RAZOR
<BOBTreeMenu TItem="object" Trigger="TreeMenuTrigger.Hover" HoverOpenDelay="100">
    <BOBTreeMenuItem Text="Hover me" Icon="@BOBIconKeys.UI.Settings">
        <ChildContent>
            <BOBTreeMenuItem Text="Profile" />
            <BOBTreeMenuItem Text="Appearance" />
            <BOBTreeMenuItem Text="Account" />
        </ChildContent>
    </BOBTreeMenuItem>
</BOBTreeMenu>

Properties

BOBTreeMenu

20 rows.
PropertyTypeDefaultDescription
ChildContentRenderFragment?Content rendered inside the component.
ItemsIEnumerable<TItem>?Root items the menu renders.
KeySelectorFunc<TItem, string>?Returns a stable key for an item. Required for keyboard navigation and lazy loading.
ChildrenSelectorFunc<TItem, IEnumerable<TItem>?>?Returns the children of an item.
HasChildrenSelectorFunc<TItem, bool>?Returns whether an item has children without loading them. Enables lazy expansion via .
OnLoadChildrenFunc<TItem, Task<IEnumerable<TItem>>>?Called the first time a node is expanded with no in-memory children. Result is cached on the menu.
NodeTemplateRenderFragment<TreeMenuNode<TItem>>?Custom template for rendering the Node.
CacheTreeNodeCache<TItem>?Cache.
ExpandedKeysHashSet<string>?ExpandedKeys.
ExpandedKeysChangedEventCallback<HashSet<string>>ExpandedKeysChanged.
ExpandAllboolExpandAll.
OrientationTreeMenuOrientationTreeMenuOrientation.VerticalOrientation.
TriggerTreeMenuTriggerTreeMenuTrigger.ClickTrigger.
ExpandModeTreeMenuExpandModeTreeMenuExpandMode.InlineExpandMode.
SizeBOBSizeBOBSize.MediumVisual size of the component.
CollapsiblebooltrueCollapsible.
HoverOpenDelayint150HoverOpenDelay.
HoverCloseDelayint300HoverCloseDelay.
OnNodeClickEventCallback<TreeNodeEventArgs<TreeMenuNode<TItem>>>Raised when the NodeClick event occurs.
OnNavigateEventCallback<string>Raised when the Navigate event occurs.

BOBTreeMenuItem

12 rows.
PropertyTypeDefaultDescription
Hrefstring?Href.
Targetstring?Target.
MatchNavLinkMatchNavLinkMatch.PrefixMatch.
OnClickEventCallbackRaised when the component is clicked.
ChildContentRenderFragment?Child nodes nested inside this node. Each child registers itself recursively against the same tree.
DataObject?Arbitrary payload associated with the node and surfaced through the registration to consumers.
DisabledBooleanWhen true, the node is rendered in a disabled state and ignores activation.
IconIconKey?Material icon name displayed alongside the node text.
InitiallyExpandedBooleanWhen true, the node is expanded the first time the tree renders.
KeyString?Stable identifier for the node. When omitted, a key is derived from the node's position in the tree.
NodeContentRenderFragment?Optional render fragment that replaces the default text/icon layout for this node.
TextString?Visible label of the node.