Loading...
Loading...
SunEditor ships with 24 built-in plugins covering media, formatting, and advanced features.
Each plugin belongs to a display type that determines how it appears in the toolbar.
The display property defines how the plugin interacts with the user.
imageconfigurableUpload, resize, and align images
videoconfigurableInsert and manage video content
audioconfigurableInsert audio files with player
linkCreate and edit hyperlinks
embedconfigurableEmbed external content (YouTube, iframes)
drawingconfigurableCanvas-based drawing tool
mathconfigurableMathematical equation editor (KaTeX)
Plugins marked configurable have options you can tweak in the Playground.
Adjust image upload limits, font size units, table scroll types, mention triggers, and more. Changes apply instantly to a live editor.
Technical reference for building custom plugins β from simple command buttons to full dialog-based features.
Register plugin classes in options.plugins. The core instantiates them.
All editor services are accessed via this.$ β never import core modules directly.
Implement multiple contracts (ModuleModal, EditorComponent) to hook into lifecycles.
import { PluginCommand } from 'suneditor/src/interfaces';
class HelloWorld extends PluginCommand {
static key = 'helloWorld';
/**
* @constructor
* @param {SunEditor.Kernel} kernel - The Kernel instance
*/
constructor(kernel) {
super(kernel);
this.title = 'Hello World';
this.icon = '<span style="font-size:14px">HW</span>';
}
/**
* @override
* @type {PluginCommand['action']}
*/
action() {
this.$.html.insert('<p>Hello, World!</p>');
this.$.history.push(false);
}
}
export default HelloWorld;Choose a base class based on how your plugin interacts with the user.
PluginCommandcommandRequired: action()Button click executes action immediately
Built-in examples: blockquote, hr, strike
PluginDropdowndropdownRequired: action()Button opens menu, item click calls action()
Built-in examples: align, font, blockStyle
PluginDropdownFreedropdown-freeButton opens menu, plugin handles own events
Built-in examples: table, fontColor
PluginModalmodalRequired: open(), modalAction()Button opens modal dialog
Built-in examples: link, image, video
PluginBrowserbrowserRequired: open(), close()Button opens gallery/browser interface
Built-in examples: imageGallery
PluginFieldfieldResponds to editor input events
Built-in examples: mention
PluginInputinputToolbar input element (not a button)
Built-in examples: pageNavigator
PluginPopuppopupRequired: show(), controllerAction()Inline popup context menu
Built-in examples: anchor
A plugin can also implements other plugin type interfaces to provide multiple interaction modes.
fontSizeextends PluginInput+ PluginCommand+ PluginDropdownInput field + dropdown list + command (inc/dec) all controlling font size.
list_bulleted / list_numberedextends PluginCommand+ PluginDropdownCommand button for toggling list + dropdown for selecting list style.