- Image quick toolbar
- Link quick toolbar
- Table quick toolbar
- Audio quick toolbar
- Video quick toolbar
- Text quick toolbar
- Quick inline toolbar
Contact Support
Quick Toolbars in the ASP.NET CORE Rich Text Editor Control
29 Apr 202519 minutes to read
The Rich Text Editor has quick toolbars that act as context-menus, appearing when you click on elements like images, links, audio, video, and tables. By default, specific quick toolbar items are displayed when clicking on the corresponding element. You can customize these items using the quickToolbarSettings property.
Image quick toolbar
You can customize the quick toolbar options for images using the image
property within the quickToolbarSettings. The Rich Text Editor provides essential tools such as ‘Replace’, ‘Align’, ‘Caption’, ‘Remove’, ‘InsertLink’, ‘Display’, ‘AltText’, and ‘Dimension’ allowing seamless image management and editing directly within the content.
By configuring these options in the quickToolbarSettings property, you can enhance the editor’s functionality, ensuring a user-friendly experience for efficiently handling image elements.
<ejs-richtexteditor id="image-quick-toolbar" value="@ViewBag.value">
<e-richtexteditor-quicktoolbarsettings image="@ViewBag.image"></e-richtexteditor-quicktoolbarsettings>
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @"<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>";
ViewBag.items = new[] { "Image" };
ViewBag.image = new[] { "Replace", "Align", "Caption", "Remove", "InsertLink", "OpenImageLink", "-",
"EditImageLink", "RemoveImageLink", "Display", "AltText", "Dimension" };
return View();
}
}
Link quick toolbar
The link quick toolbar appears when you click on a link in the editor. You can customize its items using the link
property in the quickToolbarSettings.
The Rich Text Editor provides essential tools in the link quick toolbar, including “Open”, “Edit Link”, “Remove Link”, and “Custom Tool”.
The following example demonstrates how to customize the link quick toolbar using the quickToolbarSettings property.
<ejs-richtexteditor id="link" value="@ViewBag.value">
<e-richtexteditor-quicktoolbarsettings link="@ViewBag.link"></e-richtexteditor-quicktoolbarsettings>
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @"<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>";
ViewBag.items = new[] { "CreateLink" };
ViewBag.link = new[] { "Open", "Edit", "UnLink", "FontColor"};
return View();
}
}
Table quick toolbar
The table quick toolbar opens when you click anywhere within a table. Customize its items using the table
property in the quickToolbarSettings.
The quick toolbar appears when clicking on a table, providing easy access to table-related commands. You can customize the quick toolbar by adding or removing tools using the quickToolbarSettings property.
The following sample demonstrates the customiztion of table quick toolbar.
<ejs-richtexteditor id="table" value="@ViewBag.value">
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
<e-richtexteditor-quicktoolbarsettings table="@ViewBag.Table"></e-richtexteditor-quicktoolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.items = new[] { "CreateTable" };
ViewBag.Table = new[] {"TableHeader", "TableRows", "TableColumns", "TableCell"};
ViewBag.value = @"<h2>Discover the Table's Powerful Features</h2><p>A table can be created in the editor using either a keyboard shortcut or the toolbar. With the quick
toolbar, you can
perform table cell insert, delete, split, and merge operations. You can style the table cells using
background
colours and borders.</p><table class='e-rte-table' style='width: 100%; min-width: 0px; height: 151px'>
<thead>
<tr>
<th><span>Name</span><br/></th>
<th><span>Age</span><br/></th>
<th><span>Gender</span><br/></th>
<th><span>Occupation</span><br/></th>
</tr>
</thead>
<tbody>
<tr>
<td>Selma Rose</td>
<td>30</td>
<td>Female</td>
<td><span>Engineer</span><br/></td>
</tr>
<tr>
<td><span>Robert</span><br/></td>
<td>28</td>
<td>Male</td>
<td><span>Graphic Designer</span></td>
</tr>
<tr>
<td><span>William</span><br/></td>
<td>35</td>
<td>Male</td>
<td>Teacher</td>
</tr>
</tbody>
</table>";
return View();
}
}
Audio quick toolbar
Customize the quick toolbar items for audio elements using the audio
property in the quickToolbarSettings.The Rich Text Editor provides essential tools such as “AudioReplace”, “Remove”, and “AudioLayoutOption”, allowing seamless management and editing of audio content.
By configuring these options in the quickToolbarSettings property, you can enhance the editor’s capabilities, ensuring a user-friendly experience for handling audio elements efficiently.
<ejs-richtexteditor id="audio-quick-toolbar" value="@ViewBag.value">
<e-richtexteditor-quicktoolbarsettings audio="@ViewBag.audio"></e-richtexteditor-quicktoolbarsettings>
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @"<p><b>Get started with Quick Toolbar to click on an audio</b></p>
<p>Using the quick toolbar, users can replace, display, and delete the selected audio.</p>
<p><audio controls><source src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Audio.wav' type='audio/mp3' /></audio></p>";
ViewBag.items = new[] { "Audio" };
ViewBag.audio = new[] { "AudioReplace", "Remove", "AudioLayoutOption"};
return View();
}
}
Video quick toolbar
The video quick toolbar appears when you click on a video element. You can customize its tools using the video
property in the quickToolbarSettings.
The Rich Text Editor allows you to tailor the video quick toolbar with essential tools such as “VideoReplace”, “VideoAlign”, “VideoRemove”, “VideoLayoutOption”, and “VideoDimension”, enabling seamless management of embedded videos.
By configuring these options in the quickToolbarSettings property, you enhance the editor’s capabilities, ensuring a user-friendly experience for editing and customizing video elements effortlessly.
<ejs-richtexteditor id="video-quick-toolbar" value="@ViewBag.value">
<e-richtexteditor-quicktoolbarsettings video="@ViewBag.video"></e-richtexteditor-quicktoolbarsettings>
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @" <p>Rich Text Editor allows inserting video and audio from online sources and the local computers where you want to insert a video and audio into your content.</p>
<p><b>Get started with Quick Toolbar to click on a video</b></p>
<p>Using the quick toolbar, users can replace, align, display, dimension, and delete the selected video.</p>
<p>
<video controls>
<source src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Ocean-Waves.mp4'
style='width: 30%;' type='video/mp4' />
</video>
</p>";
ViewBag.items = new[] { "Video" };
ViewBag.video = new[] { "VideoReplace", "VideoAlign", "VideoRemove", "VideoLayoutOption", "VideoDimension"};
return View();
}
}
Text quick toolbar
The text quick toolbar provides easy access to commonly used formatting tools, enabling users to apply styles and adjustments effortlessly. This enhances the editing experience by streamlining text formatting.
Customize the quick toolbar items using the text
property in the quickToolbarSettings. Any toolbar items available in the Rich Text Editor can be configured for the text quick toolbar. The example below demonstrates its customization.
<ejs-richtexteditor id="text" value="@ViewBag.value">
<e-richtexteditor-quicktoolbarsettings text="@ViewBag.text"></e-richtexteditor-quicktoolbarsettings>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @"<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>";
ViewBag.text = new[] { "Bold", "Italic", "Underline", "FontColor", "BackgroundColor", "Alignments", "-", "FontSize", "FontName", "Formats", "OrderedList", "UnorderedList"};
return View();
}
}
Quick inline toolbar
Quick commands are opened as context-menu on clicking the corresponding element. The commands must be passed as string collection to image, text, link and table attributes of the quickToolbarSettings property.
Target Element | Default Quick Toolbar items |
---|---|
image | ‘Replace’, ‘Align’, ‘Caption’, ‘Remove’, ‘InsertLink’, ‘Display’, ‘AltText’,’Dimension’. |
link | ‘Open’, ‘Edit’, ‘UnLink’. |
text | null (Any toolbar items in the Rich Text Editor can be configured here). |
table | ‘TableHeader’, ‘TableRows’, ‘TableColumns’, ‘BackgroundColor’, ‘-‘, ‘TableRemove’, ‘Alignments’, ‘TableCellVerticalAlign’, ‘Styles’. |
Custom tool can be added to the corresponding quick toolbar, using quickToolbarSettings property.
The below sample demonstrates the option to insert the image to the Rich Text Editor content as well as option to rotate the image through the quick toolbar.
<div class="control-section">
<ejs-richtexteditor id="inline" toolbarClick="onToolbarClick" created="onCreated" value="@ViewBag.value">
<e-richtexteditor-inlinemode enable="true" onSelection="true">
</e-richtexteditor-inlinemode>
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
<e-richtexteditor-quicktoolbarsettings image="@ViewBag.image"></e-richtexteditor-quicktoolbarsettings>
</ejs-richtexteditor>
</div>
<style>
.e-rte-quick-popup .e-rte-quick-toolbar .e-rotate-left::before {
content: "\e341";
}
.e-rte-quick-popup .e-rte-quick-toolbar .e-rotate-right::before {
content: "\e354";
}
</style>
<script>
function onCreated() {
defaultRTE = this;
}
function onToolbarClick(e) {
var nodeObj = new ej.richtexteditor.NodeSelection();
var range = nodeObj.getRange(defaultRTE.contentModule.getDocument());
var imgEle = nodeObj.getNodeCollection(range)[0];
var transform;
if (e.item.tooltipText === 'Rotate Right') {
transform = (imgEle.style.transform === '') ? 0 :
parseInt(imgEle.style.transform.split('(')[1].split(')')[0], 10);
imgEle.style.transform = 'rotate(' + (transform + 90) + 'deg)';
}
else if (e.item.tooltipText === 'Rotate Left') {
transform = (imgEle.style.transform === '') ? 0 :
Math.abs(parseInt(imgEle.style.transform.split('(')[1].split(')')[0], 10));
imgEle.style.transform = 'rotate(-' + (transform + 90) + 'deg)';
}
}
</script>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.value = @"<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>";
ViewBag.items = new[] { "Bold", "Italic", "Underline",
"Formats", "Alignments", "-", "OrderedList", "UnorderedList", "Image",
"CreateLink" };
object tools1 = new
{
tooltipText = "Rotate Left",
template = "<button class='e-tbar-btn e-btn' id='roatateLeft'><span class='e-btn-icon e-icons e-rotate-left'></span>"
};
object tools2 = new
{
tooltipText = "Rotate Right",
template = "<button class='e-tbar-btn e-btn' id='roatateRight'><span class='e-btn-icon e-icons e-rotate-right'></span>"
};
ViewBag.image = new[] {
"Replace", "Align", "Caption", "Remove", "InsertLink", "OpenImageLink", "-",
"EditImageLink", "RemoveImageLink", "Display", "AltText", "Dimension",tools1
, tools2
};
return View();
}
}