Quick Toolbars in JavaScript Rich Text Editor control

18 Nov 20182 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.

Rich Text Editor features are segregated into individual feature-wise modules. To use quick toolbar features, inject the quick toolbar module using the RichTextEditor.Inject(QuickToolbar).

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’, ‘WrapText’, ‘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.

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.

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 Rich Text Editor provides essential tools in the table quick toolbar, such as ‘Tableheader’, ‘TableRemove’, ‘TableRows’, ‘TableColumns’, ‘TableCell’, ‘Styles’, ‘BackgroundColor’, ‘Alignments’, ‘TableCellVerticalAlign’, ‘TableEditProperties’, ‘TableCellProperties’.

The following sample demonstrates the customization of table quick toolbar.

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.

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.

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.

Render quick toolbar in document body

To render the quick toolbar and inline toolbar in the document body, configure enableAppendToBody in quickToolbarSettings. This prevents clipping and improves visibility in constrained layouts, such as when the editor’s dimensions are very small.

The following example demonstrates how to render the quick toolbar directly in the document body using enableAppendToBody in quickToolbarSettings.