menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfMenu<TValue> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfMenu<TValue>

    Menu is a graphical user interface that serve as navigation headers for your application.

    Inheritance
    System.Object
    SfBaseComponent
    Syncfusion.Blazor.Navigations.Internal.SfMenuBase<TValue>
    SfMenu<TValue>
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    Namespace: Syncfusion.Blazor.Navigations
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfMenu<TValue> : SfMenuBase<TValue>, IMenu
    Type Parameters
    Name
    TValue

    Constructors

    SfMenu()

    Declaration
    public SfMenu()

    Properties

    HamburgerMode

    Gets or sets a value that indicates whether to enable or disable the hamburger mode.

    Declaration
    public bool HamburgerMode { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the hamburger mode can be enabled. Otherwise, false.

    Orientation

    Gets or sets a value that indicates the orientation of menu whether it can be horizontal or vertical.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type Description
    Orientation

    One of the Orientation enumeration. The default value is Orientation.Horizontal/>

    Remarks

    If the Orientation is Horizontal, the menu items will be aligned horizontally. If the Orientation is Vertical, the menu items will be aligned vertically.

    Target

    Gets or sets a value that indicates the target element to open/close Menu while click in Hamburger mode.

    Declaration
    public string Target { get; set; }
    Property Value
    Type Description
    System.String

    Accepts the string value. The default value is empty.

    Title

    Gets or sets a value that indicates the title text for hamburger mode in Menu.

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    System.String

    Accepts the string value. The default value is HEADERTITLE.

    Methods

    BuildRenderTree(RenderTreeBuilder)

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

    CloseAsync()

    Closes the Menu if it is opened in hamburger mode.

    Declaration
    public Task CloseAsync()
    Returns
    Type
    System.Threading.Tasks.Task

    GetItemIndex(TValue, Boolean)

    Gets the index of the menu item from the menu based on the given argument.

    Declaration
    public List<int> GetItemIndex(TValue item, bool isUniqueId = false)
    Parameters
    Type Name Description
    TValue item

    Item to be passed to get the index.

    System.Boolean isUniqueId

    Set true if it is a unique id.

    Returns
    Type
    System.Collections.Generic.List<System.Int32>

    OnAfterRenderAsync(Boolean)

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Navigations.Internal.SfMenuBase<TValue>.OnAfterRenderAsync(System.Boolean)

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Navigations.Internal.SfMenuBase<TValue>.OnInitializedAsync()

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.Navigations.Internal.SfMenuBase<TValue>.OnParametersSetAsync()

    OpenAsync()

    Opens the menu in the hamburger mode.

    Declaration
    public Task OpenAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved