alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class BlockEditorActionMenu

    Gets or sets the settings for the block actions menu in the editor.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    BlockEditorActionMenu
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.BlockEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class BlockEditorActionMenu : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    This allows configuration of available actions such as edit, delete, or duplicate within each block.

    Constructors

    BlockEditorActionMenu()

    Declaration
    public BlockEditorActionMenu()

    Properties

    Closing

    Triggers when the block actions menu is being closed.

    Declaration
    [Parameter]
    public EventCallback<ActionMenuClosingEventArgs> Closing { get; set; }
    Property Value
    Type Description
    EventCallback<ActionMenuClosingEventArgs>

    An event callback that provides the ActionMenuClosingEventArgs.

    Remarks

    This is triggered when the menu is dismissed either by selecting an action or clicking outside.

    Enable

    Specifies whether the block actions menu is enabled.

    Declaration
    [Parameter]
    public bool Enable { get; set; }
    Property Value
    Type Description
    bool

    A boolean value that indicates whether the block actions menu is enabled. The default value is true.

    Remarks

    If set to false, the actions menu will not be displayed or interactive.

    EnableTooltip

    Specifies whether to enable tooltips for the block actions menu items.

    Declaration
    [Parameter]
    public bool EnableTooltip { get; set; }
    Property Value
    Type Description
    bool

    A boolean value that indicates whether tooltips are enabled for menu items. The default value is true.

    Remarks

    If set to false , tooltips will not be shown when hovering over menu items.

    ItemSelect

    Triggers when an action item is selected from the block actions menu.

    Declaration
    [Parameter]
    public EventCallback<ActionMenuItemSelectEventArgs> ItemSelect { get; set; }
    Property Value
    Type Description
    EventCallback<ActionMenuItemSelectEventArgs>

    An event callback that provides the ActionMenuItemSelectEventArgs.

    Remarks

    This event helps to identify which action item was selected and apply the corresponding logic.

    Examples
    private void OnItemSelect(ActionMenuItemSelectEventArgs args)
    {
        Console.WriteLine($""Action selected: {args.Item}"");
    }

    Items

    Gets or sets the available action items in the block actions menu.

    Declaration
    [Parameter]
    public List<BlockActionItemModel> Items { get; set; }
    Property Value
    Type Description
    List<BlockActionItemModel>

    A List<T> that defines the menu options available for blocks. The default value is null.

    Remarks

    This collection determines the commands shown when the block actions menu is opened.

    If not set or set to null, the menu will appear empty or use the component's default actions.

    Each menu item can trigger specific actions when selected, such as formatting changes, block transformations, or custom operations.

    The order of items in the collection determines their display order in the menu.

    Examples
    // Define custom action menu items for the block editor
    var blockEditor = new SfBlockEditor();
    blockEditor.Items = new List<BlockActionItemModel>
    {
        new BlockActionItemModel 
        { 
            Text = "Convert to Heading", 
            Id = "heading-action",
            IconCss = "e-icons e-heading-icon" 
        },
        new BlockActionItemModel 
        { 
            Text = "Add Comment", 
            Id = "comment-action",
            IconCss = "e-icons e-comment-icon" 
        },
        new BlockActionItemModel 
        { 
            Text = "Delete Block", 
            Id = "delete-action",
            IconCss = "e-icons e-delete-icon" 
        }
    };
    
    // Handle action selection
    blockEditor.OnActionSelect = (args) => 
    {
        if (args.Id == "heading-action") 
        {
            // Convert selected block to heading
        }
        // Handle other actions...
    };

    Opening

    Triggers when the block actions menu is being opened.

    Declaration
    [Parameter]
    public EventCallback<ActionMenuOpeningEventArgs> Opening { get; set; }
    Property Value
    Type Description
    EventCallback<ActionMenuOpeningEventArgs>

    An event callback that provides the ActionMenuOpeningEventArgs.

    Remarks

    You can use this event to perform additional logic such as disabling a particular menu item for a particular block while the actions menu becomes visible.

    PopupHeight

    Specifies the height of the block actions menu popup.

    Declaration
    [Parameter]
    public string PopupHeight { get; set; }
    Property Value
    Type Description
    string

    A string value representing the popup height. Accepts values in pixels ("px"), percentage ("%"), or "auto".

    Remarks

    This property controls the vertical dimension of the menu popup. The default is "auto".

    PopupWidth

    Specifies the width of the block actions menu popup.

    Declaration
    [Parameter]
    public string PopupWidth { get; set; }
    Property Value
    Type Description
    string

    A string value representing the popup width. Accepts values in pixels ("px"), percentage ("%"), or "auto".

    Remarks

    This property controls the horizontal dimension of the menu popup. The default is "230px".

    Methods

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    OwningComponentBase.Dispose(bool)

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved