Important changes to Tiny Cloud pricing > Find out more

Autoresize Plugin

Automatically resize TinyMCE to fit content.

Contribute to this page

This plugin automatically resizes the editor to the content inside it. It is typically used to prevent the editor from expanding infinitely as a user types into the editable area. For example, by giving the autoresize_max_height option a value the editor will stop resizing when the set value is reached.

Type: String

Autoresize plugin example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize"
});

Options

These settings affect the execution of the Autoresize plugin, including changes to the minimum width, height, bottom margin, and default initialization state.

autoresize_bottom_margin

This option allows you to specify the size of the padding at the bottom of the editor's body set on initialization.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_bottom_margin: 50
});

autoresize_max_height

This option enables you to specify the maximum height that the editor will automatically resize to when a user enters text into the editor. In other words, the editor will stop automatically resizing when the set value is reached.

Type: Number

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

autoresize_min_height

This option enables you to specify the minimum height of the editor when it's initialized.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  autoresize_min_height: 350
});

autoresize_on_init

This option allows you to set whether the editor will attempt to resize itself upon initialization. By default this option is set to true.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_on_init: false
});

autoresize_overflow_padding

This option allows you to specify the size of the padding at the sides of the editor's body set on initialization.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_overflow_padding: 50
});

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.