Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
14b0968
979389: Added a blazor documentation for block editor
premanandh2205 Dec 10, 2025
bab2166
Merge branch 'development' into 979389-block-editor
premanandh2205 Dec 10, 2025
b4870a2
979389: Added a build-in-blocks sections in block editor
premanandh2205 Dec 11, 2025
7aaa595
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
premanandh2205 Dec 11, 2025
8bd3734
979389: Updated the images
premanandh2205 Dec 11, 2025
440b93e
Merge branch 'development' into 979389-block-editor
premanandh2205 Dec 11, 2025
1a32603
Merge branch 'development' of https://github.com/syncfusion-content/b…
premanandh2205 Dec 11, 2025
d0815a9
979389: Update the block editor
premanandh2205 Dec 11, 2025
abaf259
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
premanandh2205 Dec 11, 2025
dca6844
979389: update the toc file
premanandh2205 Dec 11, 2025
b2873a1
998260: Globalization & Paste Cleanup contents
manikandan-mariappan Dec 11, 2025
f0acdc5
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
manikandan-mariappan Dec 11, 2025
677741c
979389: Update the review corrections
premanandh2205 Dec 11, 2025
b7c7f32
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
premanandh2205 Dec 11, 2025
aea3223
979389: editor menus and undo redo doc
SenthilarasuBalu Dec 11, 2025
af7d83e
979389: remove unwanted files
premanandh2205 Dec 11, 2025
0e670bc
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
premanandh2205 Dec 11, 2025
1ff8433
979389: events changes pushed
SenthilarasuBalu Dec 11, 2025
533a4e2
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
SenthilarasuBalu Dec 11, 2025
1ea99c1
998260: UG corrections Phase 1
manikandan-mariappan Dec 11, 2025
9dde2cd
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
manikandan-mariappan Dec 11, 2025
31e2f11
979389: Update the getting started image
premanandh2205 Dec 12, 2025
75ca6c6
979389: doc addition
SenthilarasuBalu Dec 12, 2025
ef8a9b8
998669: UG content and sample corrections
manikandan-mariappan Dec 12, 2025
96bd0d4
Merge branch '979389-block-editor' of https://github.com/syncfusion-c…
manikandan-mariappan Dec 12, 2025
27b8506
998669: Corrections, image errors resolved
manikandan-mariappan Dec 12, 2025
05ebfbb
Merge branch 'development' into 979389-block-editor
manikandan-mariappan Dec 12, 2025
4f004ad
979389: review corrections
SenthilarasuBalu Dec 12, 2025
e507890
Merge branch 'development' into 979389-block-editor
IndrajithSrinivasan Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions blazor-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,28 @@
</li>
</ul>
</li>
<li><a href="/blazor/blockeditor/built-in-blocks/built-in-blocks">Built-in Blocks</a>
<ul>
<li><a href="/blazor/blockeditor/built-in-blocks/typography">Typography</a></li>
<li><a href="/blazor/blockeditor/built-in-blocks/table-block">Table Blocks</a></li>
<li><a href="/blazor/blockeditor/built-in-blocks/list-types">List-Types</a></li>
<li><a href="/blazor/blockeditor/built-in-blocks/inline-content">Inline Content</a></li>
<li><a href="/blazor/blockeditor/built-in-blocks/embed">Embeds</a></li>
</ul>
</li>
<li><a href="/blazor/blockeditor/editor-menus">Editor Menus</a></li>
<li><a href="/blazor/blockeditor/paste-cleanup">Paste Cleanup</a></li>
<li><a href="/blazor/blockeditor/undo-redo">Undo and redo</a></li>
<li><a href="/blazor/blockeditor/globalization">Globalization</a></li>
<li><a href="/blazor/blockeditor/keyboard-shortcuts">Keyboard Shortcuts</a></li>
<li><a href="/blazor/blockeditor/appearance">Appearance</a></li>
<li><a href="/blazor/blockeditor/events">Events</a></li>
<li>Validation and Security
<ul>
<li><a href="/blazor/blockeditor/validation-security/cross-site-script">Cross-Site Scripting</a></li>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the heading as Editor Security

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

<li><a href="/blazor/blockeditor/validation-security/read-only-mode">Controlling Editor Access</a></li>
</ul>
</li>
</ul>
</li>
<li>Breadcrumb
Expand Down
284 changes: 284 additions & 0 deletions blazor/blockeditor/appearance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
---
layout: post
title: Appearance in Blazor Block Editor Component | Syncfusion
description: Checkout and learn here all about Appearance with Syncfusion Blazor Block Editor component in Blazor Server App and Blazor WebAssembly App.
platform: Blazor
control: BlockEditor
documentation: ug
---

# Appearance in Blazor Block Editor component

The Block Editor component provides several properties to customize its visual appearance, allowing you to control its dimensions, styling, and behavior.

## Setting width and height

You can specify the width and height for the Block Editor component using the `Width` and `Height` properties.

```cshtml
@using Syncfusion.Blazor.BlockEditor;
<SfBlockEditor Width="100%" Height="80vh"></SfBlockEditor>
// Or with specific pixel values
<SfBlockEditor Width="800px" Height="500px"></SfBlockEditor>
```

## Setting readonly mode

You can utilize the `ReadOnly` property to control whether the editor is in read-only mode. When set to `true`, users cannot edit the content but can still view it.

```cshtml
@using Syncfusion.Blazor.BlockEditor;
<SfBlockEditor ReadOnly=true></SfBlockEditor>
```

## Customization using CSS Class

You can use the `CssClass` property to customize the appearance of the Block Editor component.

```cshtml
@using Syncfusion.Blazor.BlockEditor;
<SfBlockEditor Width="600px" Height="400px" CssClass="custom-editor-theme"></SfBlockEditor>
```

The following example demonstrates the usage of `Readonly` and `CssClass` properties of the Block Editor.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readonly - ReadOnly


```cshtml
@using Syncfusion.Blazor.BlockEditor
@using Syncfusion.Blazor.Buttons
<div id="container">
<SfBlockEditor @ref="BlockEditorRef"
CssClass="@CssClasses"
ReadOnly="@IsReadonly"
Blocks="@Blocks"
Focus="OnEditorFocus"
Blur="OnEditorBlur">
</SfBlockEditor>
<div id="controls">
<h3>Appearance Configuration Demo</h3>
<div class="button-group">
<SfButton @onclick="ToggleReadonly">Toggle Readonly Mode</SfButton>
<SfButton @onclick="ApplyCustomTheme">Apply Custom Theme</SfButton>
</div>
<div id="statusText" style="margin-top: 10px;">
<strong>Current Status: </strong>@StatusMessage
</div>
</div>
<div id="output">@OutputMessage</div>
</div>
@code {
private SfBlockEditor? BlockEditorRef;
private bool IsReadonly { get; set; } = false;
private string CurrentTheme { get; set; } = "default";
private string StatusMessage { get; set; } = "Editable, Default Theme";
private string OutputMessage { get; set; } = "";
private string CssClasses => $"{CurrentTheme} {(IsReadonly ? "readonly-mode" : "")}".Trim();
private List<BlockModel> Blocks => new List<BlockModel>
{
new BlockModel
{
BlockType = BlockType.Heading,
Properties = new HeadingBlockSettings { Level = 1 },
Content = new List<ContentModel>
{
new ContentModel { ContentType = ContentType.Text, Content = "Appearance Configuration Demo" }
}
},
new BlockModel
{
BlockType = BlockType.Paragraph,
Content = new List<ContentModel>
{
new ContentModel { ContentType = ContentType.Text, Content = "This demo showcases different appearance configurations including readonly mode and a custom CSS theme." }
}
},
new BlockModel
{
BlockType = BlockType.Heading,
Properties = new HeadingBlockSettings { Level = 2 },
Content = new List<ContentModel>
{
new ContentModel { ContentType = ContentType.Text, Content = "Configured Custom Theme" }
}
},
new BlockModel
{
BlockType = BlockType.BulletList,
Content = new List<ContentModel>
{
new ContentModel { ContentType = ContentType.Text, Content = "Gradient background with modern styling" }
}
},
new BlockModel
{
BlockType = BlockType.Paragraph,
Content = new List<ContentModel>
{
new ContentModel
{
ContentType = ContentType.Text,
Content = "Use the readonly toggle to switch between editable and read-only modes. In readonly mode, you can view content but cannot make changes."
}
}
}
};
private void ToggleReadonly()
{
IsReadonly = !IsReadonly;
UpdateStatus();
DisplayOutput($"Readonly mode {(IsReadonly ? "enabled" : "disabled")}. {(IsReadonly ? "Content is now view-only." : "Content is now editable.")}");
}
private void ApplyCustomTheme()
{
CurrentTheme = "custom-theme";
UpdateStatus();
DisplayOutput("Custom theme applied. The editor now features a gradient background with modern styling and hover effects.");
}
private void OnEditorFocus()
{
DisplayOutput("Editor focused. You can now type or edit content.");
}
private void OnEditorBlur()
{
DisplayOutput("Editor lost focus.");
}
protected override void OnInitialized()
{
UpdateStatus();
}
private void UpdateStatus()
{
string mode = IsReadonly ? "Readonly" : "Editable";
string theme = CurrentTheme == "default" ? "Default" : "Custom";
StatusMessage = $"{mode}, {theme} Theme";
}
private void DisplayOutput(string msg)
{
OutputMessage = msg;
StateHasChanged();
}
}
<style>
#container {
margin: 50px;
gap: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
#controls {
margin-bottom: 20px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #f8f9fa;
}
.button-group {
margin-bottom: 15px;
}
.button-group button {
margin: 5px;
padding: 8px 16px;
background-color: #17a2b8;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.button-group button:hover {
background-color: #138496;
}
.status-info {
padding: 10px;
background-color: #d1ecf1;
border-left: 4px solid #17a2b8;
border-radius: 4px;
}
.status-info p {
margin: 0;
color: #0c5460;
}
#output {
margin-top: 15px;
padding: 10px;
background-color: #f8f9fa;
border-radius: 4px;
min-height: 50px;
font-family: monospace;
white-space: pre-wrap;
}
/* Custom Theme CSS Class */
.custom-theme {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 12px;
}
.custom-theme .e-block {
border-radius: 8px;
margin-bottom: 10px;
backdrop-filter: blur(10px);
}
.custom-theme .e-block:hover {
transform: translateY(-2px);
transition: all 0.3s ease;
}
.custom-theme .e-block-content,
.custom-theme .e-floating-icon {
color: #fff;
font-weight: 500;
}
/* Readonly Mode Styling */
.readonly-mode {
opacity: 0.8;
cursor: not-allowed;
}
.readonly-mode .e-block-content {
color: #6c757d;
}
.custom-theme.readonly-mode .e-block-content {
color: #101111;
}
</style>
```
![Blazor Block Editor Appearance](./images/appearance.png)

![Blazor Block Editor Custom Styles](./images/customStyles.png)
Loading