Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 11 additions & 10 deletions blazor/rich-text-editor/style.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
layout: post
title: Style and appearance in Blazor RichTextEditor Component | Syncfusion
description: Checkout and learn here all about Style and appearance in Syncfusion Blazor RichTextEditor component and more.
title: Style and appearance in Blazor Rich Text Editor Component | Syncfusion
description: Checkout and learn here all about Style and appearance in Syncfusion Blazor Rich Text Editor component and more.
platform: Blazor
control: RichTextEditor
documentation: ug
---

# Style and Appearance
# Styling and Appearance

## Set placeholder

Expand Down Expand Up @@ -43,7 +43,8 @@ Use the `e-rte-placeholder` class to define the custom font family, font color,

## Source code view

The Rich Text Editor enables you to directly edit HTML code through the `Source View` in the text area. Any changes you make in Source view are immediately reflected in the editor's content, giving you greater flexibility and control over your work.
The Rich Text Editor allows users to directly edit HTML code using the `Source View` mode. Changes made in Source View are instantly reflected in the editor's content, providing enhanced flexibility and control over content formatting.

The source code is presented with enhanced formatting and consistent indentation for both block-level and inline HTML elements, resulting in a cleaner, more readable, and user-friendly editing experience.

>While the visual alignment of the source code is improved, the editor's underlying value remains unchanged.
Expand All @@ -60,7 +61,7 @@ The source code is presented with enhanced formatting and consistent indentation

## Customizing editor content

Use the following CSS to customize the default Rich Text Editor's content properties like font-family, font-size and color.
Apply the following CSS to customize the default content styling of the Rich Text Editor like font-family, font-size and color.

```css
/* To change font family and font size */
Expand All @@ -80,9 +81,9 @@ Use the following CSS to customize the default Rich Text Editor's content proper

![Blazor RichTextEditor with customizing editor content](./images/blazor-richtexteditor-editor-content.png)

## Customizing editor toolbar
## Customize toolbar appearance

Use the following CSS to customize the default color of the Rich Text Editor's toolbar icon.
Apply the following CSS to modify the default color of toolbar icons in the Rich Text Editor.

```css
/* To change font color for toolbar icon */
Expand Down Expand Up @@ -112,7 +113,7 @@ Use the following CSS to customize the default color of the Rich Text Editor's t
```
![Blazor RichTextEditor with customizing editor toolbar](./images/blazor-richtexteditor-editor-toolbar.png)

### Refresh editor
### Refreshing the editor UI

While rendering the Rich Text Editor inside the dialog component, the dialog container and its wrapper elements are styled with display: none, so the editor’s toolbar does not get the proper offset width and will render above the edit area container. To resolve this issue, call the `RefreshUI` method of the RichTextEditor in the dialog's opened event.

Expand All @@ -130,7 +131,7 @@ While rendering the Rich Text Editor inside the dialog component, the dialog con

Programmatically highlight a portion of the text in the editor, like setting the background color of the text by applying background style to the particular text using the RichTextEditor [ExecuteCommand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ExecuteCommandOption.html) method and the `jsinterop` method.

Refer the jsintrob method in the `<head>` wwwroot/jsinterop.js of the file.
Refer to the `jsinterop` method in the `<head>` wwwroot/jsinterop.js of the file.

{% tabs %}
{% highlight razor tabtitle="~/_jsinterop.js" %}
Expand All @@ -147,7 +148,7 @@ window.RichTextEditor = {
{% endhighlight %}
{% endtabs %}

Refer script in the `<head>` of the **~/Pages/_Host.cshtml** file.
Include the script reference in the `<head>` of the **~/Pages/_Host.cshtml** file.

{% tabs %}
{% highlight razor tabtitle="~/-Host.cshtml" %}
Expand Down
55 changes: 28 additions & 27 deletions blazor/rich-text-editor/toolbar.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: post
title: Toolbar in Blazor RichTextEditor | Syncfusion
description: Checkout and learn here all about Toolbar in Syncfusion Blazor RichTextEditor component and much more.
title: Toolbar Configuration in Blazor Rich Text Editor | Syncfusion
description: Checkout and learn here all about Toolbar in Syncfusion Blazor Rich Text Editor component and much more.
platform: Blazor
control: RichTextEditor
documentation: ug
---

# Toolbar types in Blazor RichTextEditor
# Toolbar types in Blazor Rich Text Editor

The Rich Text Editor toolbar contains a collection of tools such as bold, Italic, and text alignment buttons that are used to format the content.
The Rich Text Editor toolbar provides a collection of tools such as Bold, Italic, and text alignment buttons used to format the content.

You can customize the toolbar configurations by using the [RichTextEditorToolbarSettings.Type](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Type) property. The types of toolbar are:

Expand All @@ -18,9 +18,9 @@ You can customize the toolbar configurations by using the [RichTextEditorToolbar
3. Scrollable
4. Popup

## Expand Toolbar
## Expand toolbar

The expand toolbar allows to hide the overflowing items in the next line by using the [ToolbarType.Expand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Expand) property. By clicking the expand arrow, you can view the overflowing toolbar items. The default mode of toolbar is `Expand`.
The [Expand](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Expand) toolbar hides overflowing items in the next line using the property. By clicking the expand arrow, you can view the overflowing toolbar items. The default mode of toolbar is `Expand`.

{% tabs %}
{% highlight razor %}
Expand All @@ -32,9 +32,9 @@ The expand toolbar allows to hide the overflowing items in the next line by usin

![Blazor RichTextEditor expand toolbar](./images/blazor-richtexteditor-expand-toolbar.png)

## Multi-row Toolbar
## Multi-row toolbar

You can display the toolbar items in a row-wise format by using the [ToolbarType.MultiRow](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_MultiRow) property. All toolbar items are visible always.
The [MultiRow]((https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_MultiRow)) toolbar displays items in multiple rows, ensuring all items are always visible.

{% tabs %}
{% highlight razor %}
Expand All @@ -46,9 +46,9 @@ You can display the toolbar items in a row-wise format by using the [ToolbarType

![Blazor RichTextEditor multirow toolbar](./images/blazor-richtexteditor-multirow-toolbar.png)

## Scrollable Toolbar
## Scrollable toolbar

You can display the toolbar items in a single line with horizontal scrolling by using the [ToolbarType.Scrollable](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Scrollable) property.
The [Scrollable](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Scrollable) toolbar displays items in a single row with horizontal scrolling enabled.

{% tabs %}
{% highlight razor %}
Expand All @@ -62,7 +62,7 @@ You can display the toolbar items in a single line with horizontal scrolling by

## Configuring a popup toolbar

You can display the toolbar items in a popup container by setting the [ToolbarType.Popup](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Popup) property, which optimizes the toolbar layout for limited space and smaller screens.
The [Popup](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.ToolbarType.html#Syncfusion_Blazor_RichTextEditor_ToolbarType_Popup) toolbar property displays items in a popup container, ideal for limited space or smaller screens.

{% tabs %}
{% highlight razor %}
Expand All @@ -74,7 +74,7 @@ You can display the toolbar items in a popup container by setting the [ToolbarTy

![Blazor RichTextEditor multirow toolbar](./images/blazor-richtexteditor-popup-toolbar.png)

## Floating Toolbar
## Floating toolbar

By default, toolbar is float at the top of the Rich Text Editor on scrolling. It can be customized by specifying the offset of the floating toolbar from documents top position using [FloatingToolbarOffset](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_FloatingToolbarOffset).

Expand All @@ -101,7 +101,7 @@ The Rich Text Editor allows you to position the toolbar at the top or bottom of

By default, the toolbar is displayed at the top of the editor, making all formatting and editing tools immediately accessible above the content.

To position the toolbar at the bottom, use the [RichTextEditorToolbarSettings.Position](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Position) property and set its value to `Bottom`. This places the toolbar below the content area, which can help maintain a cleaner top layout and improve accessibility in certain use cases.
To move the toolbar to the bottom, use the [RichTextEditorToolbarSettings.Position](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Position) property and set its value to `Bottom`. This places the toolbar below the content area, which can help maintain a cleaner top layout and improve accessibility in certain use cases.

{% tabs %}
{% highlight razor %}
Expand All @@ -113,7 +113,7 @@ To position the toolbar at the bottom, use the [RichTextEditorToolbarSettings.Po

![Blazor RichTextEditor multirow toolbar](./images/blazor-richtexteditor-bottom-toolbar.png)

## Quick Toolbar
## Quick toolbar

The Rich text editor has quick toolbars that are open as context-menu on clicking the image, link, audio, video and table elements. By default, the below quick toolbar items show on click on the corresponding elements. You can customize the quick toolbar items using the [RichTextEditorQuickToolbarSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html) property.

Expand All @@ -126,9 +126,9 @@ The Rich text editor has quick toolbars that are open as context-menu on clickin
| [Video](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.VideoToolbarCommand.html#fields) | VideoReplace, VideoAlign, VideoRemove, VideoLayoutOption, VideoDimension |
| [Text](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.VideoToolbarCommand.html#fields) |No Default item have it and it support the all toolbar items |

### Image quick Toolbar
### Image quick toolbar

You can customize the inserted image in the editor by using the [RichTextEditorQuickToolbarSettings.Image](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Image) property. The image quick toolbar has the following items.
Customize the inserted image using the [RichTextEditorQuickToolbarSettings.Image](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Image) property. The image quick toolbar has the following items.

| Image Toolabr items | Description |
| --------------------| ------------- |
Expand All @@ -151,9 +151,9 @@ You can customize the inserted image in the editor by using the [RichTextEditorQ

![Blazor RichTextEditor image quick toolbar](./images/blazor-richtexteditor-image-quick-toolbar.png)

### Link quick Toolbar
### Link quick toolbar

You can customize the selected link inside the editor through the quick toolbar by using [RichTextEditorQuickToolbarSettings.Link](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Link) property. The quick toolbar for link has the following options.
Customize the selected link using the [RichTextEditorQuickToolbarSettings.Link](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Link) property. The quick toolbar for link has the following options.

| Tools | Description |
|----------------|--------------------------------------|
Expand All @@ -171,9 +171,9 @@ You can customize the selected link inside the editor through the quick toolbar

![Blazor RichTextEditor link quick toolbar](./images/blazor-richtexteditor-link-quick-toolbar.png)

### Table quick Toolbar
### Table quick toolbar

Quick toolbar is opened by clicking the table. You can customize the table by using the [RichTextEditorQuickToolbarSettings.Table](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Table) property. It has different sets of commands to be performed on the table which increases the feasibility to edit the table easily.
The table quick toolbar appears when clicking on a table. You can customize the table by using the [RichTextEditorQuickToolbarSettings.Table](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Table) property. It has different sets of commands to be performed on the table which increases the feasibility to edit the table easily.

| Tools | Description |
|----------------|--------------------------------------|
Expand All @@ -195,9 +195,9 @@ Quick toolbar is opened by clicking the table. You can customize the table by us

![Blazor RichTextEditor table quick toolbar](./images/blazor-richtexteditor-table-quick-toolbar.png)

### Audio quick Toolbar
### Audio quick toolbar

The Rich Text Editor allows you to customize the inserted audio by using the [RichTextEditorQuickToolbarSettings.Audio](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Audio) property. The audio quick toolbar has the following items.
Customize the inserted audio using the [RichTextEditorQuickToolbarSettings.Audio](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Audio) property. The audio quick toolbar has the following items.

| Tools | Description |
|----------------|--------------------------------------|
Expand All @@ -215,9 +215,9 @@ The Rich Text Editor allows you to customize the inserted audio by using the [Ri

![Blazor RichTextEditor audio quick toolbar](./images/blazor-richtexteditor-audio-quick-toolbar.png)

### Video quick Toolbar
### Video quick toolbar

The Rich Text Editor allows you to customize the inserted video by using the [RichTextEditorQuickToolbarSettings.video](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Video) property. The video quick toolbar has the following items.
Customize the inserted video using the [RichTextEditorQuickToolbarSettings.video](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Video) property. The video quick toolbar has the following items.

| Tools | Description |
|----------------|--------------------------------------|
Expand All @@ -239,9 +239,9 @@ The Rich Text Editor allows you to customize the inserted video by using the [Ri

N> You can refer to our [Blazor Rich Text Editor](https://www.syncfusion.com/blazor-components/blazor-rich-text-editor) feature tour page for its groundbreaking feature representations. You can also explore our [Blazor Rich Text Editor](https://blazor.syncfusion.com/demos/rich-text-editor/overview?theme=bootstrap5) example to knows how to render and configure the rich text editor tools.

### Text quick Toolbar
### Text quick toolbar

By activating the "RichTextEditorQuickToolbarSettings.Text" property, the Rich Text Editor offers the ability to display a quick toolbar when needed. The floating toolbar shows up when you select or focus on editable text. By modifying the "RichTextEditorQuickToolbarSettings.Text" property, the commands shown in the text quick toolbar can be changed.
By activating the [RichTextEditorQuickToolbarSettings.Text](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorQuickToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorQuickToolbarSettings_Text) property, the Rich Text Editor offers the ability to display a quick toolbar when needed. The floating toolbar shows up when you select or focus on editable text. By modifying the `RichTextEditorQuickToolbarSettings.Text` property, the commands shown in the text quick toolbar can be changed.

{% tabs %}
{% highlight razor %}
Expand Down Expand Up @@ -269,7 +269,8 @@ private List<ToolbarItemModel> textQuickToolbarItems = new List<ToolbarItemModel
{% endhighlight %}
{% endtabs %}

Refer the following link for more items in the text quick toolbar.
Refer to the following link for a complete list of available toolbar items:

https://blazor.syncfusion.com/documentation/rich-text-editor/tools/built-in-tools

{% tabs %}
Expand Down
Loading