Skip to main content

Editor Size

These options control the dimensions of the editor and whether the user can resize it.

Options

OptionTypeDefaultDescription
widthstring/numberelement widthWidth of the editor. Accepts a number (pixels) or a CSS string such as '100%'.
heightstring/numbermax(element height, 400)Height of the editor. Accepts a number (pixels) or a CSS string.
min_widthnumberMinimum width in pixels. Prevents the user from resizing below this value.
max_widthnumberMaximum width in pixels. Prevents the user from resizing above this value.
min_heightnumber100Minimum height in pixels.
max_heightnumberMaximum height in pixels.
resizeboolean/stringtrueControls the resize handle. true for vertical resizing only, 'both' for vertical and horizontal, false to disable.
note

For automatic height adjustment based on content, see the Autoresize plugin.

Example

editor42.init({
selector: 'textarea',
width: '100%',
height: 600,
min_height: 300,
max_height: 900,
resize: 'both'
});