Class CommandItemModel
Specifies the command item model in the SfBlockEditor component.
Inherited Members
Namespace: Syncfusion.Blazor.BlockEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class CommandItemModel
Constructors
CommandItemModel()
Declaration
public CommandItemModel()
Properties
Disabled
Gets or sets a value indicating whether the command item is disabled in SfBlockEditor.
Declaration
public bool Disabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Remarks
When disabled, the item cannot be interacted with by the user.
GroupBy
Gets or sets the group header of the command item in SfBlockEditor.
Declaration
public string GroupBy { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string value used to group related command items. |
Remarks
This text is shown as a header above grouped command items.
ID
Gets or sets the unique identifier of the command item in SfBlockEditor.
Declaration
public string ID { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string value that uniquely identifies the command item. |
Remarks
This ID can be used to reference the item programmatically.
IconCss
Gets or sets the CSS class for the icon of the command item in SfBlockEditor.
Declaration
public string IconCss { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string containing one or more CSS classes. |
Remarks
This allows the item to display a visual icon alongside its label.
Label
Gets or sets the label text of the command item in SfBlockEditor.
Declaration
public string Label { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the display text of the item. |
Remarks
This text is shown to the user in the command menu.
Shortcut
Gets or sets the keyboard shortcut for the command item in SfBlockEditor.
Declaration
public string Shortcut { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string key combination for keyboard shortcut. |
Remarks
This allows users to trigger the command using a specific key combination
Tooltip
Gets or sets the tooltip of the command item in SfBlockEditor.
Declaration
public string Tooltip { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string containing the tooltip text. |
Remarks
The tooltip is shown when hovering over the item to describe its action.
Type
Gets or sets the block type of the command item in SfBlockEditor.
Declaration
[JsonConverter(typeof(JsonStringEnumConverter))]
public BlockType Type { get; set; }
Property Value
| Type | Description |
|---|---|
| BlockType | A BlockType value representing the content type of the block. The default value is Paragraph. |
Remarks
The block type determines how the content is rendered and interacted with. Available options include:
Examples
<SfBlockEditor @bind-Blocks="@BlogContent" />
@code {
private List<BlockModel> BlogContent = new()
{
// Heading block with level settings
new BlockModel
{
BlockType = BlockType.Heading,
Properties = new HeadingBlockSettings { Level = 1 },
Content = new List<ContentModel>
{
new ContentModel { ContentType = ContentType.Text, Content = "Welcome to the Block Editor Demo!" }
}
}
};
}