Skip to content
122 changes: 0 additions & 122 deletions MAUI/Rich-Text-Editor/Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,128 +11,6 @@ documentation: ug

The .NET MAUI Rich Text Editor control provides extensive options for customizing its appearance and functionality, from the toolbar and editor area to programmatic formatting and hyperlink management.

## Customizing the Toolbar

The [SfRichTextEditor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html) toolbar is highly customizable, allowing you to control its items, styling, and position.

### Add or Remove Toolbar Items

By default, the toolbar includes a comprehensive set of formatting tools. You can specify a custom set of items by populating the [ToolbarItems](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html#Syncfusion_Maui_RichTextEditor_SfRichTextEditor_ToolbarItems) collection. This allows you to add or remove any built-in toolbar item.

The following items are available to be added to the `ToolbarItems` collection:
* `Bold`, `Italic`, `Underline`, `Strikethrough`
* `SubScript`, `SuperScript`
* `FontFamily`, `FontSize`, `TextColor`, `HighlightColor`
* `ParagraphFormat` , `Alignment`
* `NumberList`, `BulletList`
* `IncreaseIndent`, `DecreaseIndent`
* `Hyperlink`, `Image`, `Table`
* `Undo`, `Redo`
* `Separator`

{% tabs %}
{% highlight xaml %}

<rte:SfRichTextEditor ShowToolbar="True">
<rte:SfRichTextEditor.ToolbarItems>
<!-- Define a custom set of toolbar items -->
<rte:RichTextToolbarItem Type="Bold" />
<rte:RichTextToolbarItem Type="Italic" />
<rte:RichTextToolbarItem Type="Underline" />
<rte:RichTextToolbarItem Type="Separator" />
<rte:RichTextToolbarItem Type="NumberList" />
<rte:RichTextToolbarItem Type="BulletList" />
</rte:SfRichTextEditor.ToolbarItems>
</rte:SfRichTextEditor>

{% endhighlight %}
{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ShowToolbar = true;
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Bold });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Italic });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Underline });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Separator });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.NumberList });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.BulletList });

{% endhighlight %}
{% endtabs %}

### Customize Toolbar Appearance

You can customize the visual style of the toolbar using the `ToolbarSettings` property. This gives you access to the [RichTextEditorToolbarSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html) object, which has several properties for changing its appearance.

* [BackgroundColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackgroundColor): Sets the Background color or brush of the toolbar.
* [TextColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_TextColor) : Sets the color of the toolbar item icons.
* [IsScrollButtonVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_IsScrollButtonVisible): Sets the scroll button visibility.
* [SeparatorColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SeparatorColor): Sets the color of the separator lines between toolbar items.
* [SeparatorThickness](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SeparatorThickness): Sets the thickness of the separator lines.
* [ForwardIconBackground](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_ForwardIconBackground): Sets the background color of the forward scroll icon.
* [ForwardIconColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_ForwardIconColor): Sets the color of the forward scroll icon.
* [BackwardIconBackground](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackwardIconBackground): Sets the background color of the backward scroll icon.
* [BackwardIconColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackwardIconColor): Sets the color of the backward scroll icon.
* [SelectionColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SelectionColor): Sets the color for toolbar text hover and selection color.


{% tabs %}
{% highlight xaml %}

<rte:SfRichTextEditor ShowToolbar="True">
<rte:SfRichTextEditor.ToolbarSettings>
<rte:RichTextEditorToolbarSettings BackgroundColor="SkyBlue" SelectionColor="Brown"
TextColor="Orange" IsScrollButtonVisible="True"
SeparatorColor="Brown" SeparatorThickness="5"
ForwardIconBackground="Blue" ForwardIconColor="Green"
BackwardIconBackground="Yellow" BackwardIconColor="Green"/>
</rte:SfRichTextEditor.ToolbarSettings>
</rte:SfRichTextEditor>

{% endhighlight %}
{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ShowToolbar = true;
richTextEditor.ToolbarSettings = new RichTextEditorToolbarSettings
{
IsScrollButtonVisible = true,
TextColor = Colors.Orange,
BackgroundColor = Colors.SkyBlue,
SelectionColor = Colors.Brown,
SeparatorColor = Colors.Brown,
SeparatorThickness = 5,
ForwardIconBackground = Colors.Blue,
ForwardIconColor = Colors.Green,
BackwardIconBackground = Colors.Yellow,
BackwardIconColor = Colors.Green
};

{% endhighlight %}
{% endtabs %}

![.NET MAUI Rich Text Editor with Toolbar settings](images/richtexteditor-toolbar-settings.png)


### Customize Toolbar Position

The toolbar can be positioned at the top or bottom of the editor control using the [ToolbarPosition](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html#Syncfusion_Maui_RichTextEditor_SfRichTextEditor_ToolbarPosition) property.

{% tabs %}
{% highlight xaml %}

<rte:SfRichTextEditor ShowToolbar="True" ToolbarPosition="Bottom" />

{% endhighlight %}
{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ShowToolbar = true;
richTextEditor.ToolbarPosition = RichTextEditorToolbarPosition.Bottom;

{% endhighlight %}
{% endtabs %}

## Customizing Editor Appearance

The [SfRichTextEditor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html) provides several properties to customize the appearance of the main editor area, including its background, border, and text wrapping behavior.
Expand Down
3 changes: 1 addition & 2 deletions MAUI/Rich-Text-Editor/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,4 @@ To migrate easily from [`Xamarin SfRichTextEditor`](https://help.syncfusion.com/
* `Nested ScrollView:` RichTextEditor scroll behavior is incompatible with parent ScrollView containers and will be automatically disabled.
* `AutoSize Configuration:` To prevent off-screen rendering when AutoSize is enabled, configure the MaximumHeightRequest property to constrain the control within viewport boundaries.
* `Keyboard Interaction:` Toolbar visibility is affected when MaximumHeightRequest extends into the on-screen keyboard area, causing automatic hiding.
* `Supported Content Types:` Editor content is restricted to plain text and HTML markup formats only.

* `Supported Content Types:` Editor content is restricted to plain text and HTML markup formats only.
140 changes: 140 additions & 0 deletions MAUI/Rich-Text-Editor/Toolbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
layout: post
title: Toolbar in .NET MAUI Rich Text Editor | Syncfusion®
description: Learn here all about Toolbar features in Syncfusion® .NET MAUI Rich Text Editor (SfRichTextEditor) control.
platform: maui
control: Rich Text Editor
documentation: ug
---

# Toolbar in .NET MAUI Rich Text Editor (SfRichTextEditor)

## Toolbar position

The Rich Text Editor allows you to position the toolbar at the top or bottom of the content area, depending on your layout requirements. By default, the toolbar appears at the top on Windows and macOS, and at the bottom on Android and iOS for better accessibility.

{% tabs %}

{% highlight xaml %}

<rte:SfRichTextEditor ToolbarPosition="Bottom" />

{% endhighlight %}

{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ToolbarPosition = RichTextEditorToolbarPosition.Bottom;

{% endhighlight %}
{% endtabs %}

## Link quick tooltip

The link quick tooltip appears when you click on a link in the editor. The Rich Text Editor provides essential tools in the link quick tooltip, including “Open”, “Edit Link” and “Remove Link”.

![.NET MAUI Rich Text Editor Link Quick Tooltip](images/richtexteditor-link-quick-tooltip.png)

N> The link quick tooltip will automatically disappear after 2 seconds if there is no user interaction.

## Customizing the Toolbar

The [SfRichTextEditor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html) toolbar is highly customizable, allowing you to control its items, styling, and position.

### Add or Remove Toolbar Items

By default, the toolbar includes a comprehensive set of formatting tools. You can specify a custom set of items by populating the [ToolbarItems](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.SfRichTextEditor.html#Syncfusion_Maui_RichTextEditor_SfRichTextEditor_ToolbarItems) collection. This allows you to add or remove any built-in toolbar item.

The following items are available to be added to the `ToolbarItems` collection:
* `Bold`, `Italic`, `Underline`, `Strikethrough`
* `SubScript`, `SuperScript`
* `FontFamily`, `FontSize`, `TextColor`, `HighlightColor`
* `ParagraphFormat` , `Alignment`
* `NumberList`, `BulletList`
* `IncreaseIndent`, `DecreaseIndent`
* `Hyperlink`, `Image`, `Table`
* `Undo`, `Redo`
* `Separator`

{% tabs %}
{% highlight xaml %}

<rte:SfRichTextEditor ShowToolbar="True">
<rte:SfRichTextEditor.ToolbarItems>
<!-- Define a custom set of toolbar items -->
<rte:RichTextToolbarItem Type="Bold" />
<rte:RichTextToolbarItem Type="Italic" />
<rte:RichTextToolbarItem Type="Underline" />
<rte:RichTextToolbarItem Type="Separator" />
<rte:RichTextToolbarItem Type="NumberList" />
<rte:RichTextToolbarItem Type="BulletList" />
</rte:SfRichTextEditor.ToolbarItems>
</rte:SfRichTextEditor>

{% endhighlight %}
{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ShowToolbar = true;
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Bold });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Italic });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Underline });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.Separator });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.NumberList });
richTextEditor.ToolbarItems.Add(new RichTextToolbarItem() { Type = RichTextToolbarOptions.BulletList });

{% endhighlight %}
{% endtabs %}

### Customize Toolbar Appearance

You can customize the visual style of the toolbar using the `ToolbarSettings` property. This gives you access to the [RichTextEditorToolbarSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html) object, which has several properties for changing its appearance.

* [BackgroundColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackgroundColor): Sets the Background color or brush of the toolbar.
* [TextColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_TextColor) : Sets the color of the toolbar item icons.
* [IsScrollButtonVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_IsScrollButtonVisible): Sets the scroll button visibility.
* [SeparatorColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SeparatorColor): Sets the color of the separator lines between toolbar items.
* [SeparatorThickness](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SeparatorThickness): Sets the thickness of the separator lines.
* [ForwardIconBackground](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_ForwardIconBackground): Sets the background color of the forward scroll icon.
* [ForwardIconColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_ForwardIconColor): Sets the color of the forward scroll icon.
* [BackwardIconBackground](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackwardIconBackground): Sets the background color of the backward scroll icon.
* [BackwardIconColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_BackwardIconColor): Sets the color of the backward scroll icon.
* [SelectionColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Maui_RichTextEditor_RichTextEditorToolbarSettings_SelectionColor): Sets the color for toolbar text hover and selection color.


{% tabs %}
{% highlight xaml %}

<rte:SfRichTextEditor ShowToolbar="True">
<rte:SfRichTextEditor.ToolbarSettings>
<rte:RichTextEditorToolbarSettings BackgroundColor="SkyBlue" SelectionColor="Brown"
TextColor="Orange" IsScrollButtonVisible="True"
SeparatorColor="Brown" SeparatorThickness="5"
ForwardIconBackground="Blue" ForwardIconColor="Green"
BackwardIconBackground="Yellow" BackwardIconColor="Green"/>
</rte:SfRichTextEditor.ToolbarSettings>
</rte:SfRichTextEditor>

{% endhighlight %}
{% highlight c# %}

SfRichTextEditor richTextEditor = new SfRichTextEditor();
richTextEditor.ShowToolbar = true;
richTextEditor.ToolbarSettings = new RichTextEditorToolbarSettings
{
IsScrollButtonVisible = true,
TextColor = Colors.Orange,
BackgroundColor = Colors.SkyBlue,
SelectionColor = Colors.Brown,
SeparatorColor = Colors.Brown,
SeparatorThickness = 5,
ForwardIconBackground = Colors.Blue,
ForwardIconColor = Colors.Green,
BackwardIconBackground = Colors.Yellow,
BackwardIconColor = Colors.Green
};

{% endhighlight %}
{% endtabs %}

![.NET MAUI Rich Text Editor with Toolbar settings](images/richtexteditor-toolbar-settings.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions maui-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@
<li><a href="/maui/Rich-Text-Editor/Getting-Started">Getting Started</a></li>
<li><a href="/maui/Rich-Text-Editor/Migration">Migrate from Xamarin.Forms</a></li>
<li><a href="/maui/Rich-Text-Editor/Advanced-Features">Advanced Features</a></li>
<li><a href="/maui/Rich-Text-Editor/Toolbar">Toolbar</a></li>
<li><a href="/maui/Rich-Text-Editor/AutoSize">AutoSize</a></li>
<li><a href="/maui/Rich-Text-Editor/Image-Insertion">Image Insertion</a></li>
<li><a href="/maui/Rich-Text-Editor/Table-Insertion">Table Insertion</a></li>
Expand Down