Class HeadingBlockSettings
Represents settings specific to a heading block used in the SfBlockEditor.
Inherited Members
Namespace: Syncfusion.Blazor.BlockEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class HeadingBlockSettings : BlockSettings
Remarks
The HeadingBlockSettings type configures heading-specific behavior such as the display level
(from 1 to 4) and an optional placeholder text shown when the heading has no content.
Assign an instance of this settings class to BlockModel.Properties when BlockModel.BlockType is
Heading.
Use Level to control semantic importance and visual size (for example, 1 for page title,
2 for section, 3 for subsection). When the heading contains no text, the value of
Placeholder is shown as guidance text until the user provides input.
Performance: Rendering headings is lightweight; however, large documents with many blocks will scale rendering costs linearly with the number of BlockModel instances. This class is not thread-safe; update instances only from the UI thread.
Localization: Provide localized placeholder text via resource files to ensure a consistent experience across locales.
Examples
Creates heading blocks with different levels and placeholder text inside an SfBlockEditor.
<!-- Razor markup -->
<SfBlockEditor @bind-Blocks="Blocks" />
@code {
private List<BlockModel> Blocks = new()
{
new BlockModel
{
ID = "heading-block",
BlockType = BlockType.Heading,
Properties = new HeadingBlockSettings
{
Level = 1,
Placeholder = "Add a title..."
},
Content = new List<ContentModel>
{
new ContentModel
{
ID = "heading-content",
ContentType = ContentType.Text,
Content = "Welcome to the Block Editor Demo!"
}
}
},
new BlockModel
{
ID = "subheading-block",
BlockType = BlockType.Heading,
Properties = new HeadingBlockSettings
{
Level = 3
},
Content = new List<ContentModel>
{
new ContentModel
{
ID = "subheading-content",
ContentType = ContentType.Text,
Content = "List Types"
}
}
}
};
}
Constructors
HeadingBlockSettings()
Declaration
public HeadingBlockSettings()
Properties
Level
Gets or sets the heading level of a Heading block in the SfBlockEditor.
Declaration
public int Level { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An int indicating the heading level. Valid values are from |
Remarks
The level maps to semantic and visual hierarchy similar to HTML heading levels (h1�h6).
Choose levels that reflect the document outline and accessibility best practices.
Values outside the range 1�6 may be clamped or ignored by the component depending on configuration.
If theming maps font size to level, lower numbers render larger headings.
Performance: Changing the level is a lightweight operation affecting only rendering of the specific block.
Placeholder
Gets or sets the placeholder text displayed when a Heading block has no content in the SfBlockEditor.
Declaration
public string Placeholder { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the placeholder text shown for an empty heading.
The default value is |
Remarks
Use this property to provide guidance to users (for example, "Add a title..."). The placeholder is not
displayed once the heading contains user-entered content.
If the value is null or empty, no placeholder text is rendered.
For localization, provide region-specific placeholder text via resource files to ensure a consistent experience across locales.