Class RadzenMenu
A horizontal menu component with support for nested submenus, icons, and responsive behavior. RadzenMenu provides a classic menu bar for navigation, typically used in application headers or toolbars. Displays menu items horizontally with dropdown submenus. Supports multi-level nested menus via RadzenMenuItem child items, automatic navigation via Path property or custom Click handlers, icons displayed alongside menu item text, responsive design that automatically collapses to a hamburger menu on small screens (configurable), click-to-open or hover-to-open interaction modes, keyboard navigation (Arrow keys, Enter, Escape) for accessibility, and visual separators between menu items. Use for application navigation bars, command menus, or toolbar-style interfaces. Menu items are defined using RadzenMenuItem components as child content.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenMenu : RadzenComponentWithChildren, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Examples
Basic menu with navigation:
<RadzenMenu>
<RadzenMenuItem Text="Home" Path="/" Icon="home" />
<RadzenMenuItem Text="Data">
<RadzenMenuItem Text="Orders" Path="/orders" />
<RadzenMenuItem Text="Customers" Path="/customers" />
</RadzenMenuItem>
<RadzenMenuItem Text="Reports" Path="/reports" />
</RadzenMenu>
Menu with click handlers:
<RadzenMenu Click=@OnMenuClick>
<RadzenMenuItem Text="File">
<RadzenMenuItem Text="New" Value="new" Icon="add" />
<RadzenMenuItem Text="Open" Value="open" Icon="folder_open" />
<RadzenMenuItem Text="Save" Value="save" Icon="save" />
</RadzenMenuItem>
</RadzenMenu>
Constructors
RadzenMenu()
A horizontal menu component with support for nested submenus, icons, and responsive behavior. RadzenMenu provides a classic menu bar for navigation, typically used in application headers or toolbars. Displays menu items horizontally with dropdown submenus. Supports multi-level nested menus via RadzenMenuItem child items, automatic navigation via Path property or custom Click handlers, icons displayed alongside menu item text, responsive design that automatically collapses to a hamburger menu on small screens (configurable), click-to-open or hover-to-open interaction modes, keyboard navigation (Arrow keys, Enter, Escape) for accessibility, and visual separators between menu items. Use for application navigation bars, command menus, or toolbar-style interfaces. Menu items are defined using RadzenMenuItem components as child content.
Declaration
public RadzenMenu()
Examples
Basic menu with navigation:
<RadzenMenu>
<RadzenMenuItem Text="Home" Path="/" Icon="home" />
<RadzenMenuItem Text="Data">
<RadzenMenuItem Text="Orders" Path="/orders" />
<RadzenMenuItem Text="Customers" Path="/customers" />
</RadzenMenuItem>
<RadzenMenuItem Text="Reports" Path="/reports" />
</RadzenMenu>
Menu with click handlers:
<RadzenMenu Click=@OnMenuClick>
<RadzenMenuItem Text="File">
<RadzenMenuItem Text="New" Value="new" Icon="add" />
<RadzenMenuItem Text="Open" Value="open" Icon="folder_open" />
<RadzenMenuItem Text="Save" Value="save" Icon="save" />
</RadzenMenuItem>
</RadzenMenu>
Properties
Click
Gets or sets the click callback.
Declaration
[Parameter]
public EventCallback<MenuItemEventArgs> Click { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<MenuItemEventArgs> | The click callback. |
ClickToOpen
Gets or sets the interaction mode for opening submenus. When true, submenus open on click. When false, submenus open on hover (desktop) and click (touch devices).
Declaration
[Parameter]
public bool ClickToOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Responsive
Gets or sets whether the menu should automatically collapse to a hamburger menu on small screens. When enabled, displays a toggle button that expands/collapses the menu on mobile devices.
Declaration
[Parameter]
public bool Responsive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ToggleAriaLabel
Gets or sets the add button aria-label attribute.
Declaration
[Parameter]
public string ToggleAriaLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
AddItem(RadzenMenuItem)
Adds the item.
Declaration
public void AddItem(RadzenMenuItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| RadzenMenuItem | item | The item. |
BuildRenderTree(RenderTreeBuilder)
A horizontal menu component with support for nested submenus, icons, and responsive behavior. RadzenMenu provides a classic menu bar for navigation, typically used in application headers or toolbars. Displays menu items horizontally with dropdown submenus. Supports multi-level nested menus via RadzenMenuItem child items, automatic navigation via Path property or custom Click handlers, icons displayed alongside menu item text, responsive design that automatically collapses to a hamburger menu on small screens (configurable), click-to-open or hover-to-open interaction modes, keyboard navigation (Arrow keys, Enter, Escape) for accessibility, and visual separators between menu items. Use for application navigation bars, command menus, or toolbar-style interfaces. Menu items are defined using RadzenMenuItem components as child content.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose()
Detaches event handlers and disposes Reference.
Declaration
public override void Dispose()
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
| Type | Description |
|---|---|
| string |
Overrides
OnInitialized()
Called by the Blazor runtime.
Declaration
protected override void OnInitialized()