Documentation / API Reference

Extrabar

add #

Arguments
name String
button Object

Adds a button to the extrabar. The extrabar appears to the right of the toolbar.

Redactor.add('plugin', 'myplugin', {
    start() {
        this.app.extrabar.add('mybutton', {
            title: 'My Button',
            icon: '<svg...>',
            command: 'myplugin.toggle'
        });
    },
    toggle(params, button) {
        // do something
    }
});

Now call the editor with the plugin created:

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

The button should appear in the extrabar. The button click will call the plugin's toggle method.

See more about the parameters of the buttons.