User interface options

Configure the editor's appearance, including menu and toolbar controls.

Contribute to this page

branding

Use the branding option to disable the “Powered by Tiny” displayed in the status bar for product attribution.

Note: The “Powered by Tiny” product attribution is required for users on the Tiny Cloud Starter plan. Product attribution is optional for premium users.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  branding: false
});

color_picker_callback

This option enables you to provide your own color picker.

Type: JavaScript Function

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  color_picker_callback: function(callback, value) {
    callback('#FF00FF');
  }
});

contextmenu

The contextmenu option allows you to specify which items appear on the context menu. The format of this option is a space separated list of items in a string.

The context menu option accepts three styles of item:

  • Any registered menu item.
  • A "|" pipe character to indicate a separator should be added to delineate a group of menu items.
  • Context menu sections defined by a plugin (usually equal to the plugin name). Separators are automatically inserted between context menu sections.

If the same name is registered as both a context menu section and a menu item, the section takes preference.

The default configuration includes all plugins that provide a context menu; link, image, imagetools, table, and spellchecker.

Type: String

Default configuration example

tinymce.init({
  selector: "textarea",
  contextmenu: "link image imagetools table spellchecker"
});

Further examples of the contextmenu option are available in the context menu examples.

contextmenu_never_use_native

The contextmenu_never_use_native option allows you to disable the browser’s native context menu from appearing within the editor.

Caution: Using this option may result into unexpected behavior when right-clicking in text areas. We advise you to consider all your options carefully before using this feature.

Type: Boolean

Default Value: false

Example

tinymce.init({
  selector: "textarea",
  contextmenu_never_use_native: true
});

custom_ui_selector

Use the custom_ui_selector option to specify the elements that you want TinyMCE to treat as a part of the editor UI. Specifying elements enables the editor not to lose the selection even if the focus is moved to the elements matching this selector. The editor blur event is not fired if the focus is moved to elements matching this selector since it’s treated as part of the editor UI.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  custom_ui_selector: '.my-custom-button'
});
...
<textarea></textarea>
<button class="my-custom-button">Button</button>

elementpath

This option allows you to disable the element path within the status bar at the bottom of the editor.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  elementpath: false
});

event_root

This option enables you to specify a CSS selector for an element to be used as the event root when the editor is in inline mode.

By default all events gets bound to the editable area. But in some implementations where the DOM gets modified you want to bind these events to a container and then delegate the events down to the right editor, based on the element ID.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  inline: true,
  event_root: '#root'
});

height

height sets the height of the entire editor, including the menubar, toolbars, and status bar.

Note: If a number is provided, TinyMCE sets the height in pixels. If a string is provided, TinyMCE assumes the value is valid CSS and simply sets the editor’s height as the string value. This allows for alternate units such as %, em, and vh.

Type: Number or String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  height: 300
});

inline

The inline option allows you to specify whether TinyMCE should work in inline mode.

TinyMCE has three main integration modes - a “classic” form-based mode, an inline editing mode, and a distraction-free mode. The inline editing mode is useful when creating user experiences where you want the editing view of the page to be merged with the reading view of the page. This creates a seamless editing experience and true WYSIWYG behavior.

Note: When in inline mode, the editor does not replace the selected element with it’s own iframe, but instead edits the element’s content in-place instead. Inline mode only operates against block elements.

Type: Boolean

Default Value: false

Possible Values: true, false

Example
tinymce.init({
  selector: '#myeditablediv',  // change this value according to your HTML
  inline: true
});

For more information on the differences between the editing modes, please see this page here.

quickbars_insert_toolbar

The quickbars_insert_toolbar option enables specifying toolbar items to include on the Quick Insert toolbar enabled by the quickbars plugin. It is recommended to only have controls in this toolbar related to inserting content. However, nothing is restricting to use any of the available toolbar controls.

Type: String

Defaults: quickimage quicktable

Example customizing the Quick Insert toolbar
tinymce.init({
  selector: 'div.tinymce',
  plugins: 'quickbars',
  inline: true,
  quickbars_insert_toolbar: 'quickimage quicktable'
});
Example disabling the Quick Insert toolbar
tinymce.init({
  selector: 'div.tinymce',
  plugins: 'quickbars',
  inline: true,
  quickbars_insert_toolbar: false
});

max_height

The max_height option has two kinds of behaviors depending on the state of the autoresize plugin:

  • autoresize OFF (Default) : Without the autoresize plugin, this option allows you to set the maximum height that a user can stretch the entire TinyMCE interface (by grabbing the dragable area in the bottom right of the editor interface).

  • autoresize ON : With the autoresize plugin, this option sets the maximum height the editor can automatically expand to.

Type: Number

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  max_height: 500
});

Pro tip: If you set the option resize to false the resize handle will be disabled and a user will not be able to resize the editor (by manual dragging). Note that resize defaults to false when the autoresize plugin is enabled.

max_width

This option allows you to set the maximum width that a user can stretch the entire TinyMCE interface (by grabbing the dragable area in the bottom right of the editor interface) when using the modern theme.

Note that this behavior is different than the autoresize plugin, which controls the resizing of the editable area only, not the entire editor.

Type: Number

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  max_width: 500
});

Pro tip: by default the resize handle does not allow horizontal dragging and giving this key a value will not result in an observable behavior.

menu

This option allows you to specify which menus should appear on TinyMCE’s menu bar and the items that should appear within the menus themselves.

To specify the menus that should appear on TinyMCE’s menu bar, the menu option should be provided with a JavaScript object containing a property for each menu. These properties should contain a JavaScript object themselves with properties title and items.

The title property should contain a string with the name of the menu. The items field should contain a space separated list of the controls that should populate the menu.

If you would like to group these menu items, please insert a | pipe character between the menu items.

Type: Object

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  menu: {
    file: {title: 'File', items: 'newdocument'},
    edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
    insert: {title: 'Insert', items: 'link media | template hr'},
    view: {title: 'View', items: 'visualaid'},
    format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
    table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
    tools: {title: 'Tools', items: 'spellchecker code'}
  }
});

If all you need is to control which menus are available and/or in what order, see the menubar parameter.

menubar

This option allows you to specify which menus should appear and the order that they appear in the menu bar at the top of TinyMCE.

To specify the menus that should appear on TinyMCE’s menu bar, the menubar option should be provided with a space separated list of menus.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  menubar: 'file edit insert view format table tools help'
});

To disable the menu bar, the menubar option should be provided a boolean value of false.

Type: Boolean

Default Value: true

Possible Values: true, false

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  menubar: false
});

If you need more control over the contents of the menus, see the menu parameter.

min_height

The min_height option has two kinds of behaviors depending on the state of the autoresize plugin:

  • autoresize OFF (Default) : Without the autoresize plugin, this option allows you to set the minimum height that a user can shrink the entire TinyMCE interface (by grabbing the dragable area in the bottom right of the editor interface).

  • autoresize ON : With the autoresize plugin, this option sets the minimum height the editor can automatically shrink to.

Type: Number

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  min_height: 100
});

Pro tip: If you set the option resize to false the resize handle will be disabled and a user will not be able to resize the editor (by manual dragging). Note that resize defaults to false when the autoresize plugin is enabled.

min_width

This option allows you to set the minimum width that a user can stretch the entire TinyMCE interface (by grabbing the dragable area in the bottom right of the editor interface) when using the modern theme.

Note that this behavior is different than the autoresize plugin, which controls the resizing of the editable area only, not the entire editor.

Type: Number

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  min_width: 400
});

Pro tip: by default the resize handle does not allow horizontal dragging and giving this key a value will not result in an observable behavior.

preview_styles

This option lets you configure the preview of styles in format/style listboxes. Enter a string with the styles that you wish to preview separated by a blankspace, or disable the preview of of all styles by setting it to false.

If unset the editor will preview the styles listed in the default value listed below.

Type: Boolean || String

Default Value: font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow

Possible Values: String, false

Example

No preview of styles:

tinyMCE.init({
  selector: 'textarea',  // change this value according to your HTML
  mode: 'textareas',
  preview_styles: false
});

Preview of only font-size and color:

tinyMCE.init({
  selector: 'textarea',  // change this value according to your HTML
  mode: 'textareas',
  preview_styles: 'font-size color'
});

removed_menuitems

This option allows you to remove items from TinyMCE’s drop down menus. This is useful if you are using the menubar option to set your menus rather than the more specific menu option.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  removed_menuitems: 'undo, redo'
});

resize

This option gives you the ability to disable the resize handle or set it to resize both horizontal and vertically. The option can be true, false or the string 'both'. False disables the resize, true enables vertical resizing only, 'both' makes it possible to resize in both directions horizontal and vertical.

Disabling the resize

Type: Boolean

Default Value: true

Possible Values: true, false, 'both'

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  resize: false
});

Enabling both vertical and horizontal resize

Type: Boolean

Default Value: true

Possible Values: true, false, 'both'

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  resize: 'both'
});

quickbars_selection_toolbar

This option enables specifying toolbar items to include on the Quick Selection toolbar or to disable the toolbar.

It is recommended that only formatting related controls are specified in this toolbar. However, any of the available toolbar controls can also be used.

Type: String

Defaults: bold italic | quicklink h2 h3 blockquote

Example customizing the Quick Selection toolbar
tinymce.init({
  selector: 'div.tinymce',
  plugins: 'quickbars',
  inline: true,
  quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote'
});
Example disabling the Quick Selection toolbar
tinymce.init({
  selector: 'div.tinymce',
  plugins: 'quickbars',
  inline: true,
  quickbars_selection_toolbar: false
});

skin_url

If you are using TinyMCE skins, this option enables you to specify the location of the skin file. This is useful if you are loading TinyMCE from one URL, for example a CDN, while loading a skin on, say, a local server.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  skin_url: '/css/mytinymceskin'
});

skin

This option allows you to specify the skin that TinyMCE should use. The default skin included with TinyMCE is named “oxide”.

Type: String

The name of the skin should match the name of the folder within the skins directory of TinyMCE. If the specified skin is not found, TinyMCE will not load.

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  skin: "oxide"
});

If you would like to create your own skin, please see the guide here.

statusbar

This option allows you to specify whether or not TinyMCE should display the status bar at the bottom of the editor. To disable the status bar, the statusbar option should be provided with a boolean false value.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  statusbar: false
});

theme_url

If you are using TinyMCE themes, this option enables you to specify the location of the theme file. This is useful if you are loading TinyMCE from one URL, for example a CDN, while loading a theme on, say, a local server.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  theme_url: '/mytheme/mytheme.js'
});

theme

This option allows you to specify the theme that TinyMCE should use. The default theme included with TinyMCE is named “silver”.

The name of the theme should match the name of the folder within the themes directory of TinyMCE. If the specified theme is not found, TinyMCE will not load.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  theme: 'silver'
});

toolbar

This option allows you to specify the buttons and the order that they will appear on TinyMCE’s toolbar.

Grouping toolbar controls

To specify the controls that should appear on TinyMCE’s toolbar, the toolbar option should be provided with a space separated list of toolbar controls. To create groups within this list, please add | pipe characters between the groups of controls that you would like to create.

Type: String

Example grouped toolbar
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  toolbar: 'undo redo | styleselect | bold italic | link image'
});

Disabling the toolbar

To disable the toolbar, the toolbar option should be provided a boolean value of false.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
    toolbar: false
});

Using multiple toolbars

To specify multiple toolbars, the toolbar option should be provided with an array of space separated strings.

Type: Array

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  toolbar: [
    'undo redo | styleselect | bold italic | link image',
    'alignleft aligncenter alignright'
  ]
});

Alternatively, you may specify multiple toolbars through the use of the toolbar(n) option.

toolbar(n)

This option allows you to specify the buttons and the order that they will appear on instances of multiple toolbars.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your html
  toolbar1: 'undo redo | styleselect | bold italic | link image',
  toolbar2: 'alignleft aligncenter alignright'
});

Please see the toolbar configuration option for details.

width

Set the width of the editor.

Note: TinyMCE sets the width in pixels if a number is provided. However, if TinyMCE is provided a string it assumes the value is valid CSS and simply sets the editor’s width as the string value. This allows for alternate units such as %, em and vh.

Type: Number or String

Example

```js tinymce.init({ selector: ‘textarea’, // change this value according to your HTML width : 300 });

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.