Documention
Configuration
Toolbar

Toolbar Configuration

This section is used to configure the display and behavior of the Umo Editor toolbar area.

Default Configuration

{
  toolbar: {
    defaultMode: 'ribbon',
    enableSourceEditor: true,
    menus: ['base', 'insert', 'table', 'tools', 'page', 'export'],
    disableMenuItems: [],
    importWord: {
      enabled: true,
      options: {},
      useCustomMethod: false,
    },
  },
}

Configuration Item Descriptions

toolbar.defaultMode

Description: The default mode of the toolbar. After configuration, users can still switch modes manually, and the choice will be saved locally. By default, the toolbar mode chosen by the user is used, but you can still force the toolbar mode to be changed using the setToolbar.

Type: String

Default: ribbon

Options: ribbon, classic

toolbar.enableSourceEditor

Description: Whether to enable the source code editing mode of the editor. In source code editing mode, users can edit the source code and preview the effects. It is suitable for developers with programming capabilities and is not recommended to be open to ordinary users.

Type: Boolean

Default: false

toolbar.menus

Description: The list of toolbar menus to be enabled. By default, all menus are enabled. By configuring this item, you can disable some menus, but you cannot disable all menus and must include the base menu.

Type: Array

Default: ['base', 'insert', 'table', 'tools', 'page', 'export']

Options: base, insert, table, tools, page, export

toolbar.disableMenuItems

Description: The menu items to be disabled. By default, no menu items are disabled.

Type: Array

Default: []

Options: print, code, video, audio, file, chineseDate, emoji, math, signature, seal, diagrams, chineseCase, mermaid, share, embed, …

toolbar.importWord Added in v3.1.0

Description: Configuration related to importing Word documents.

Type: Object

Default Value:

{
  enabled: true, 
  options: {},
  useCustomMethod: false,
}

Options:

  • enabled: Whether to enable the Word file import feature, default is true.
  • options: Mammoth configuration options, see Mammoth for details.
  • useCustomMethod: Whether to use a custom method for importing Word files. You can configure this option to use a custom import method for Word files. Default is false. If set to true, it uses the onCustomImportWordMethod method to import Word documents.