NavMenuTree, NavMenuGroup and NavMenuLink

IMPORTANT

With version 3.2 a new, much improved, set of components to build side-bar menus has been added. The demos shown here are using components which are marked obsolete and will be removed in a future version.

If you DO NOT want to upgrade to these new menu components, you can continue to use the pre-version 3.2 components. The only thing you need to do is to change the name of the FluentNavMenu component in your application to FluentNavMenuTree.

Everything works exactely as before by changing the name of this FluentNavMenu component in your application. (This probably needs to be done in one place only). The FluentNavMenuGroup and FluentNavMenuLink components have not been changed and do not need to be altered.

We consider the FluentNavMenuTree, FluentNavMenuGroup and FluentNavMenuLink components as deprecated and will remove them in a future version.

If you wish to upgrade to the new menu components, please refer to the Upgrade guide for more information.

The FluentNavMenuGroup, FluentNavMenuLink and FluentNavMenu components can be used to build hierarchical, collapsible and expandable menus. They can range from simple 1-level deep lists to complex multi-level menu structures.

None of these components are particulary useful when used stand-alone.

Examples

This demo shows 3 different versions of a NavMenu (with FluentNavMenuGoups and FluentNavMenuLinks). From left to right:
  • Menu with several sub-menus, icons, etc
  • Menu without sub-menus but with icons
  • Menu with just text links
Example

Navigation Examples

Download: 

Collapsible navigation

More complete example which shows how menu works together with a text section when it collapses.
Example

Collapsible Navigation Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce quis lorem lacus. Ut id leo non enim feugiat ultrices. Proin vulputate volutpat urna nec iaculis. Integer dui lacus, fermentum sit amet aliquet in, scelerisque vitae dui. Nulla fringilla sagittis orci eu consectetur. Fusce eget dolor non lectus placerat tincidunt. Pellentesque aliquam non odio ac porttitor. Nam finibus mattis sagittis. Ut hendrerit porttitor massa in aliquam. Duis laoreet fringilla feugiat. Sed maximus, urna in fringilla posuere, enim urna bibendum justo, vel molestie nibh orci nec lectus. Etiam a varius justo. Aenean nisl ante, interdum eget vulputate eget, iaculis ut massa. Suspendisse maximus sed purus id molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Download: 

Data bound

An example data binding the Expanded parameter.
Example

Navigation Examples

Item 1 Item 2

Expanded elements

Menu Item 1 Item 2

Selected elements

Item 1.1 Item 1.2 Item 2.1 Item 2.2
Download: 

Custom actions

An example of intercepting menu actions to provide custom behavior.
Example

Custom Actions Example

Log

Download: 

Documentation

FluentNavMenuTree Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
Collapsedbool
False
Collapsiblebool
False
Gets or sets whether or not the menu can be collapsed.
Expandedbool
True
ExpanderContentRenderFragment?
Gets or sets the content to be rendered for the expander icon when the menu is collapsible.
The default icon will be used if this is not specified.
InitiallyExpandedbool
False
If set to true then the tree will expand when it is created.
ReNavigatebool
False
If true, the menu will re-navigate to the current page when the user clicks on the currently selected menu item.
Titlestring?
Navigation menu
Gets or sets the title of the navigation menu.
Default to 'Navigation menu'.
Widthint?
Gets or sets the width of the menu (in pixels).

EventCallbacks

Name
Type
Description
ExpandedChangedEventCallback<bool>
Event callback for when the FluentNavMenuTree.Expanded property changes.
OnActionEventCallback<NavMenuActionArgs>
Called when the user attempts to execute the default action of a menu item.

FluentNavMenuGroup Class

Inherits from FluentNavMenuItemBase.
There might be parameters and/or methods shown here that are inherited from the component's base type but are not applicable to this component.

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
Collapsedbool
True
Returns true if the group is collapsed,
and false if expanded.
Disabledbool
False
Gets or sets whether the link is disabled.
Expandedbool
False
Returns true if the group is expanded,
and false if collapsed.
HasIconbool
False
Returns true if the item has an FluentNavMenuItemBase.Icon set.
Hrefstring?
Gets or sets the destination of the link.
IconIcon?
Gets or sets the icon to display with the link
Use a constant value from the FluentIcon class
InitiallyExpandedbool
False
If set to true then the tree will
expand when it is created.
Selectedbool
False
Gets or sets a value indicating whether the item is selected.
Textstring
Gets or sets the text of the link.
Widthint?
Gets or sets the width of the link (in pixels).

EventCallbacks

Name
Type
Description
ExpandedChangedEventCallback<bool>
Gets or sets a callback that is triggered whenever FluentNavMenuGroup.Expanded changes.
OnActionEventCallback<NavMenuActionArgs>
Called when the user attempts to execute the default action of a menu item.
SelectedChangedEventCallback<bool>
Event callback for when FluentNavMenuItemBase.Selected changes.

Inherits from FluentNavMenuItemBase.
There might be parameters and/or methods shown here that are inherited from the component's base type but are not applicable to this component.

Name
Type
Default
Description
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
Disabledbool
False
Gets or sets whether the link is disabled.
HasIconbool
False
Returns true if the item has an FluentNavMenuItemBase.Icon set.
Hrefstring?
Gets or sets the destination of the link.
IconIcon?
Gets or sets the icon to display with the link
Use a constant value from the FluentIcon class
Selectedbool
False
Gets or sets a value indicating whether the item is selected.
Textstring
Gets or sets the text of the link.
Widthint?
Gets or sets the width of the link (in pixels).
Name
Type
Description
OnActionEventCallback<NavMenuActionArgs>
Called when the user attempts to execute the default action of a menu item.
SelectedChangedEventCallback<bool>
Event callback for when FluentNavMenuItemBase.Selected changes.
An error has occurred. This application may no longer respond until reloaded. Reload 🗙