All Components
Theme

Themes

    Editor / Custom tools

    Information

    The following demo shows how to customize some of the native Editor tools (font size, font name and block format) by modifying the tools' item collections, as well as how to create completely custom tools.

    Description

    This example shows how to customize some of the native Editor tools (font size, font name and block format) by modifying the tools' item collections, as well as how to create completely custom tools (Content Area Background Color and Insert a Horizontal Ruler).

    You can use the Add method of the FontName, FontSize and Formatting settings to modify the default font size, font name and formatblock options set.

    To add a new custom button on the toolbar: set the Tools -> CustomButton:

    .CustomButton(cb => cb.Name("custom").ToolTip("horizontal rule").Exec("execFunction"))

    Where the Exec param should be the name of a JavaScript function that will be fired when the custom button is clicked.

    If you want to create a custom dropdown with a label next to it, you can set the Tools -> CustomTemplate and specify the HTML markup that will be rendered on the toolbar.

    ASP.NET MVC source

    Also available for:

    • custom_tools.cshtml
    • Custom_ToolsController.cs

    Support & learning resources

    Editor for other technologies