Documentation / API Reference


getElement #

Access to the Dom of the toolbar element.

let $toolbar =;
let $nodes = $toolbar.find('a');

disable #

name (optional) String

Disables all button on the toolbar.;

Disables the specified button.'mybutton');

enable #

name (optional) String

Enables all button on the toolbar.;

Enables the specified button if it was disabled.'mybutton');

setToggled #

name String

Sets the toggle state to the button.'mybutton');

unsetToggled #

name String

Removes the toggle state from the button.'mybutton');

setActive #

name String

Sets the active state to the button.'mybutton');

unsetActive #

name String

Removes the active state from the button.'mybutton');

add #

name String
button Object

Adds a button to the toolbar.

Redactor.add('plugin', 'myplugin', {
    start() {'mybutton', {
            title: 'My Button',
            icon: '<svg...>',
            command: 'myplugin.toggle'
    toggle(args) {
        // do something

In this example, Font Awesome is used for the button icon. You can add your own HTML and SVG icon.

Now call the editor with the plugin created:

Redactor('#entry', {
    plugins: ['myplugin']

The button should appear on the toolbar when you click on any block and when it pressed, will call the plugin's toggle method.

See more about the parameters of the buttons.

isSticky #

Checks if the toolbar is sticked.

let is =;