menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SlashMenuItemModel - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SlashMenuItemModel

    Represents a model for a slash menu item, containing attributes for display and interaction within the editor.

    Inheritance
    System.Object
    SlashMenuItemModel
    Namespace: Syncfusion.Blazor.RichTextEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SlashMenuItemModel : Object
    Remarks

    This model includes properties for text content, command execution, visual representation, description, and categorization, which are essential for the slash menu's operation in the editor.

    Examples

    This example demonstrates how to configure a SlashMenuItemModel for a slash menu in a SfRichTextEditor component.

     
    
    <SfRichTextEditor> 
        <RichTextEditorSlashMenuSettings Enable="true" Items="Tools" /> 
    </SfRichTextEditor> 
    @code { 
        private List<SlashMenuItemModel> Tools = new List<SlashMenuItemModel> 
        { 
            new SlashMenuItemModel 
            { 
                Text = "Heading 1", 
                Command = SlashMenuCommand.Heading1, 
                IconCss = "e-icon-heading1", 
                Description = "Formats text as a level 1 heading", 
                GroupBy = "Formatting" 
            } 
        }; 
    } 

    Constructors

    SlashMenuItemModel()

    Declaration
    public SlashMenuItemModel()

    Properties

    Command

    Gets or sets the command associated with the menu item.

    Declaration
    public Nullable<SlashMenuCommand> Command { get; set; }
    Property Value
    Type Description
    System.Nullable<SlashMenuCommand>

    A SlashMenuCommand specifying the action to perform when the menu item is selected. The default value is Heading1.

    Remarks

    The Command provides context or action specificity for detailed editor operations.

    Available commands:

    • Heading1 - Formats text as a level 1 heading
    • Heading2 - Formats text as a level 2 heading
    • Heading3 - Formats text as a level 3 heading
    • Heading4 - Formats text as a level 4 heading
    • Paragraph - Formats text as a standard paragraph
    • Blockquote - Formats text as a blockquote
    • OrderedList - Creates an ordered (numbered) list
    • UnorderedList - Creates an unordered (bulleted) list
    • Table - Inserts a table
    • Image - Inserts an image
    • Audio - Inserts an audio element
    • Video - Inserts a video element
    • CodeBlock - Formats text as a code block
    • Link - Inserts or formats a hyperlink

    Description

    Gets or sets the description of the menu item.

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

    A System.String providing a brief description of the menu item's purpose. The default value is null.

    Remarks

    The Description provides additional context or action specificity for detailed editor operations.

    GroupBy

    Gets or sets the group category for the menu item.

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

    A System.String specifying the group to which the menu item belongs. The default value is null.

    Remarks

    This property is used to organize menu items into groups in the slash menu UI.

    If set to null, the menu item may appear in a default or ungrouped category.

    IconCss

    Gets or sets the CSS class for the menu item's icon.

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

    A System.String representing the CSS class for the icon. The default value is null.

    Remarks

    This property specifies the CSS class used to render an icon next to the menu item.

    Use standard icon CSS classes compatible with the UI framework (e.g., Syncfusion icon classes).

    Text

    Gets or sets the display text for the menu item.

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

    A System.String representing the text displayed in the menu item. The default value is null.

    Remarks

    This property defines the visible text shown to the user in the slash menu.

    If set to null or an empty string, the menu item may not render correctly in the UI.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved