Class RichTextEditorSlashMenuSettings
Configures the slash menu settings for the Blazor Rich Text Editor.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.RichTextEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class RichTextEditorSlashMenuSettings : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Constructors
RichTextEditorSlashMenuSettings()
Declaration
public RichTextEditorSlashMenuSettings()
Properties
Enable
Gets or sets a value indicating whether the slash menu is enabled in the rich text editor.
Declaration
[Parameter]
public bool Enable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | A bool indicating whether the slash menu is enabled. The default value is |
Remarks
When set to true, the slash menu is displayed when the user types a slash (/) in the editor.
When set to false, the slash menu is disabled, and no menu appears.
Items
Gets or sets the collection of menu items displayed in the slash menu.
Declaration
[Parameter]
public List<SlashMenuItemModel>? Items { get; set; }
Property Value
| Type | Description |
|---|---|
| List<SlashMenuItemModel> | A List<T> of SlashMenuItemModel containing the menu items to display. The default value is an empty collection. |
Remarks
This property defines the menu items available in the slash menu.
Each item in the collection must be a valid SlashMenuItemModel instance with configured properties like Text and Command.
Examples
This example shows how to add items to the Items property.
<SfRichTextEditor>
<RichTextEditorSlashMenuSettings Items="Tools" />
</SfRichTextEditor>
@code {
private List<SlashMenuItemModel> Tools = new List<SlashMenuItemModel>
{
new SlashMenuItemModel { Text = "Heading 1", Command = SlashMenuCommand.Heading1, IconCss = "e-icon-heading1" }
};
}
PopupHeight
Gets or sets the height of the slash menu popup.
Declaration
[Parameter]
public string? PopupHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the height of the slash menu popup in CSS units (e.g., "px", "%"). The default value is |
Remarks
This property controls the height of the slash menu popup in the rich text editor.
Examples
This example shows how to set the PopupHeight property.
<SfRichTextEditor>
<RichTextEditorSlashMenuSettings PopupHeight="450px" />
</SfRichTextEditor>
PopupWidth
Gets or sets the width of the slash menu popup.
Declaration
[Parameter]
public string? PopupWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the width of the slash menu popup in CSS units (e.g., "px", "%"). The default value is |
Remarks
For responsive designs, consider using percentage-based values; otherwise, pixel values provide precise control.
If a negative value is provided, the width is set to "auto", allowing the popup to adjust dynamically based on content or layout.
Examples
This example shows how to set the PopupWidth property.
<SfRichTextEditor>
<RichTextEditorSlashMenuSettings PopupWidth="400px" />
</SfRichTextEditor>
Methods
Dispose(bool)
Dispose unmanaged resources in the Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Boolean value to dispose the object. |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |