BzEditor

Rich text editor

CKEditor 5, wired up for Persian and right-to-left.

Persian editor (RTL)

bind-Value gives you the HTML output. Right-to-left is handled for you.

HTML output:

<p>سلام! این یک ادیتور <strong>فارسی</strong> راست به چپ است.</p>
razor
@using BzCore.Components.Editor

<BzEditor @bind-Value="_html" Label="متن" Height="220px" />

<pre>@_html</pre>

@code {
    private string? _html = "<p>سلام خوبی؟ تست ادیتور <strong>فارسی</strong> راست به چپ است.</p>";
}
Read-only mode

For showing content without letting anyone edit it.

Parameter Default Description
ValueThe HTML content (use bind-Value)
LabelA label above the editor
Height260pxHeight of the writing area
ReadOnlyfalseDisables editing
ValueChangedFires when the content changes
razor
@using BzCore.Components.Editor

<BzEditor Value="@_html" ReadOnly Height="150px" />

@code {
    private string _html = "<p>این متن فقط خواندنی است و قابل ویرایش نمیباشد.</p>";
}
Setup

This component needs the CKEditor 5 script; add it once in App.razor.

razor
@* App.razor — add the CKEditor 5 script once, before blazor.web.js *@

<script src="https://cdn.ckeditor.com/ckeditor5/41.4.2/classic/ckeditor.js"></script>
<script src="_content/Blazify.Core/js/bz-core.js"></script>
<script src="_framework/blazor.web.js"></script>

@*

*@