# 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.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- [RadzenComponentWithChildren](https://blazor.radzen.com/docs/api/Radzen.RadzenComponentWithChildren.md)
- RadzenMenu

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender

## Syntax

```csharp
public class RadzenMenu : RadzenComponentWithChildren, IComponent, IHandleEvent, IHandleAfterRender
```

## Examples

Basic menu with navigation:

```razor
<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:

```razor
<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

| Constructor | Description |
|-------------|-------------|
| `public 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. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| AriaLabel | `string` | Gets or sets the menu aria label text. |
| Click | `EventCallback<MenuItemEventArgs>` | Gets or sets the click callback. |
| ClickToOpen | `bool` | 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). |
| Close | `EventCallback` | Gets or sets a callback invoked when the menu requests to be dismissed, such as pressing Escape at the root of a context menu. |
| Flyout | `bool` | 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. |
| IsContextMenu | `bool` | 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. |
| Responsive | `bool` | 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. |
| ToggleAriaLabel | `string` | Gets or sets the add button aria-label attribute. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `AddItem(RadzenMenuItem item)` | `void` | Adds the item. Parameters: `item`: The item. |
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `Dispose()` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `OnAfterRenderAsync(bool firstRender)` | `Task` |  |
| `OnInitialized()` | `void` |  |
| `SetParametersAsync(ParameterView parameters)` | `Task` |  |

## Inherited Members

- From [RadzenComponentWithChildren](https://blazor.radzen.com/docs/api/Radzen.RadzenComponentWithChildren.md): ChildContent
- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnBecameInvisible, OnContextMenu, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

