Class BlockEditorActionMenu
Gets or sets the settings for the block actions menu in the editor.
Inherited Members
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 |
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 |
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 ( |
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 ( |
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
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |