This sample demonstrates the SlashCommand feature of the Rich Text Editor UI, which allows
users to apply formatting such as headings, lists, blockquotes, and tables, as well as execute custom
commands within the editor. The slash command menu can be triggered by typing the "/" character in the
editor.
In this example, the slash command menu is enabled by setting the enable property within slashCommandSettings to true. This example includes two Custom Slash Command items that allow you to easily insert meeting notes and a signature into the content. The slash command menu is configured with the following properties: enable: Enables or disables the slash command menu in the editor. The default value is false. items: Defines the items displayed in the slash command popup. Custom items can also be added, and their actions can be handled using the slashCommanditemSelect event. Adding Custom Slash Command Items The custom items can be added to the slash command menu by defining the items child property within slashCommandSettings. The items property accepts a string of built-in items and also an array of objects, where each object represents a custom slash command item. These objects can include the following properties: text — Sets the text displayed for the slash command item. command — Specifies the action to be executed when the slash command item is clicked. type — Groups related items within the slash command menu. iconCss — Sets the CSS class for the icon associated with the item. description — Provides a description for the slash command item. Injecting the SlashCommand Module The SlashCommand feature is provided as an injectable module. To use it, inject the module using the following code: RichTextEditorUI.Inject(SlashCommand);