RadzenMenu Class

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.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenComponentWithChildren

RadzenMenu

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenMenu : RadzenComponentWithChildren, IComponent, IHandleEvent, IHandleAfterRender

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

RadzenMenuLink to this section

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()

Properties

AriaLabelLink to this section

Gets or sets the menu aria label text.

Declaration
public string AriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the menu aria label text.

ClickLink to this section

Gets or sets the click callback.

Declaration
public EventCallback<MenuItemEventArgs> Click { get; set; }
Property Value
Type Description
EventCallback<MenuItemEventArgs>Gets or sets the click callback.

ClickToOpenLink to this section

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
public bool ClickToOpen { get; set; }
Property Value
Type Description
boolGets 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).

CloseLink to this section

Gets or sets a callback invoked when the menu requests to be dismissed, such as pressing Escape at the root of a context menu.

Declaration
public EventCallback Close { get; set; }
Property Value
Type Description
EventCallbackGets or sets a callback invoked when the menu requests to be dismissed, such as pressing Escape at the root of a context menu.

FlyoutLink to this section

Gets or sets whether nested submenus should fly out horizontally to the side instead of expanding vertically inline. When enabled, 2nd level and deeper submenus appear as cascading flyout menus positioned to the right of their parent item.

Declaration
public bool Flyout { get; set; }
Property Value
Type Description
boolGets or sets whether nested submenus should fly out horizontally to the side instead of expanding vertically inline. When enabled, 2nd level and deeper submenus appear as cascading flyout menus positioned to the right of their parent item.

IsContextMenuLink to this section

Gets or sets a value indicating whether this menu is rendered as a context menu popup. When enabled, the root element uses role="menu" with vertical orientation instead of a horizontal menubar.

Declaration
public bool IsContextMenu { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this menu is rendered as a context menu popup. When enabled, the root element uses role="menu" with vertical orientation instead of a horizontal menubar.

ResponsiveLink to this section

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
public bool Responsive { get; set; }
Property Value
Type Description
boolGets 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.

ToggleAriaLabelLink to this section

Gets or sets the add button aria-label attribute.

Declaration
public string ToggleAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the add button aria-label attribute.

Methods

AddItemLink to this section

Adds the item.

Declaration
public void AddItem(RadzenMenuItem item)
Parameters
Type Name Description
RadzenMenuItem item The item.

BuildRenderTreeLink to this section

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

DisposeLink to this section

Declaration
public override void Dispose()

GetComponentCssClassLink to this section

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnAfterRenderAsyncLink to this section

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type Name Description
bool firstRender
Returns
Type Description
Task

OnInitializedLink to this section

Declaration
protected override void OnInitialized()

SetParametersAsyncLink to this section

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙