Block Class

Adds a block control button for assigning CSS class names to the current block. Replaces any existing block classes with the value you enter.

Select a block, open the control dropdown, and choose Classname. Enter one or more space-separated class names and save.

Load the bundle

<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/block-class/block-class.js"></script>

Initialization

const app = Redactor('#entry', {
    plugins: ['blockClass']
});

Options

  • icon (string)
    • SVG icon HTML for the block control button.
Redactor('#entry', {
    plugins: ['blockClass'],
    blockClass: {
        icon: '<svg...>'
    }
});

Language strings

en: {
    blockClass: {
        classname: 'Classname'
    }
}

Events

This plugin does not emit events.

API

This plugin does not expose a public API.