Class BlockEditorTransform
Provides configuration for the transform dropdown menu in the SfBlockEditor inline toolbar.
Inherited Members
Namespace: Syncfusion.Blazor.BlockEditor
Assembly: Syncfusion.Blazor.BlockEditor.dll
Syntax
public class BlockEditorTransform : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
The BlockEditorTransform component customizes the transform menu items, including text, icons, and behavior configuration. This allows you to control which block types are available for transformation and customize their appearance.
Use the Items property to define available transformation options, and configure the popup dimensions with PopupWidth and PopupHeight. Subscribe to the ItemSelect event to handle custom transformation logic.
Constructors
BlockEditorTransform()
Declaration
public BlockEditorTransform()
Properties
ItemSelect
Gets or sets the event callback that is triggered when a transform item is selected from the dropdown menu.
Declaration
[Parameter]
public EventCallback<TransformItemSelectEventArgs> ItemSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<TransformItemSelectEventArgs> | An EventCallback<TValue> of type TransformItemSelectEventArgs that handles the transform item selection event. No default value. |
Remarks
Use this event to execute custom logic when a user selects a block transformation option. The event provides access to the selected TransformItemModel and allows you to cancel the transformation by setting Cancel to true.
If Cancel is set to true, the default transformation behavior is suppressed.
Examples
<SfBlockEditor>
<BlockEditorTransform OnItemSelect="HandleTransformItemSelect" />
</SfBlockEditor>
@code {
private void HandleTransformItemSelect(TransformItemSelectEventArgs args)
{
if (args.Command.Type == BlockType.Quote)
{
// Perform custom logic for quote blocks
Console.WriteLine($"Transforming to: {args.Command.Label}");
}
}
}
Items
Gets or sets the individual items available in the transform dropdown menu.
Declaration
[Parameter]
public List<TransformItemModel> Items { get; set; }
Property Value
| Type | Description |
|---|---|
| List<TransformItemModel> | A List<T> of TransformItemModel objects that define the available block types for transformation. The default value is an empty collection. |
Remarks
If not explicitly set, the default transform items (Paragraph, Headings 1-4, Bullet List, Numbered List, Checklist) will be used.
You can customize this collection to include only the block types you want to support for transformation. Each item in the collection defines a transformation option with its block type, display label, icon, and associated metadata.
PopupHeight
Gets or sets the height of the transform dropdown popup.
Declaration
[Parameter]
public string PopupHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the CSS height of the dropdown popup. Accepts CSS-valid values such as |
Remarks
This property controls the vertical dimension of the popup menu. When set to "auto", the height automatically adjusts based on the number of items
available in the Items collection.
PopupWidth
Gets or sets the width of the transform dropdown popup.
Declaration
[Parameter]
public string PopupWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the CSS width of the dropdown popup. Accepts CSS-valid values such as |
Remarks
This property controls the horizontal dimension of the popup menu. Use standard CSS width values to ensure proper alignment with your UI layout.
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 |