Addbar

addbar#

Type: boolean | object

Default: true

Enables the addbar feature. When false, the add toolbar button is hidden.

Pass an object to customize dropdown items without disabling the feature:

Key Type Description
add object Extra dropdown items (same shape as addbarItems.
hide string[] Built-in item names to remove from the dropdown.
const app = Redactor('#entry', {
  addbar: {
    hide: ['layout', 'wrapper'],
    add: {
      clips: {
        title: 'Clips',
        command: 'clips.open'
      }
    }
  }
});

dropdown.addbar#

Type: string[]

Default: ['text', 'heading', 'image', 'todo', 'list', 'embed', 'table', 'quote', 'pre', 'line', 'layout', 'wrapper']

Button names shown in the addbar dropdown, in order. Built-in names map to block.insert commands.

Also available but not in the default list: address, dlist.

const app = Redactor('#entry', {
  dropdown: {
    addbar: ['text', 'heading', 'image', 'quote', 'table']
  }
});

addbarItems#

Type: object

Default: {}

Adds or overrides addbar dropdown items at init time.

Each key is the item name; the value is a button config (title, icon, command, params, position, etc.).

const app = Redactor('#entry', {
  addbarItems: {
    banner: {
      title: 'Banner',
      command: 'block.insert',
      params: {
        type: 'wrapper',
        template: '<div class="banner">...</div>'
      }
    }
  }
});