CKEditor Samples » Using AutoGrow Plugin

This sample shows how to configure CKEditor instances to use the AutoGrow (autogrow) plugin that lets the editor window expand and shrink depending on the amount and size of content entered in the editing area.

In its default implementation the AutoGrow feature can expand the CKEditor window infinitely in order to avoid introducing scrollbars to the editing area.

It is also possible to set a maximum height for the editor window. Once CKEditor editing area reaches the value in pixels specified in the autoGrow_maxHeight configuration setting, scrollbars will be added and the editor window will no longer expand.

To add a CKEditor instance using the autogrow plugin and its autoGrow_maxHeight attribute, insert the following JavaScript call to your code:

CKEDITOR.replace( 'textarea_id', {
	extraPlugins: 'autogrow',
	autoGrow_maxHeight: 800,

	// Remove the Resize plugin as it does not make sense to use it in conjunction with the AutoGrow plugin.
	removePlugins: 'resize'
});

Note that textarea_id in the code above is the id attribute of the <textarea> element to be replaced with CKEditor. The maximum height should be given in pixels.

Rich Text EditorEditor toolbarsDocument Source Save New Page Preview Print TemplatesClipboard/Undo Cut Copy Paste Paste as plain text Paste from Word Undo RedoEditing Find Replace Select All Check Spelling Spell Check As You Type Forms Form Checkbox Radio Button Text Field Textarea Selection Field Button Image Button Hidden FieldBasic Styles Bold Italic Underline Strike Through Subscript Superscript Remove FormatParagraph Insert/Remove Numbered List Insert/Remove Bulleted List Decrease Indent Increase Indent Block Quote Create Div Container Align Left Center Align Right Justify Text direction from left to right Text direction from right to leftLinks Link Unlink AnchorInsert Image Flash Table Insert Horizontal Line Smiley Insert Special Character Insert Page Break for Printing IFrameStylesStylesStylesFormatFormatFontFontSizeSizeColors Text Color  Background Color Tools Maximize Show Blocksabout About CKEditorPress ALT 0 for helpElements path 

Rich Text EditorEditor toolbarsDocument Source Save New Page Preview Print TemplatesClipboard/Undo Cut Copy Paste Paste as plain text Paste from Word Undo RedoEditing Find Replace Select All Check Spelling Spell Check As You Type Forms Form Checkbox Radio Button Text Field Textarea Selection Field Button Image Button Hidden FieldBasic Styles Bold Italic Underline Strike Through Subscript Superscript Remove FormatParagraph Insert/Remove Numbered List Insert/Remove Bulleted List Decrease Indent Increase Indent Block Quote Create Div Container Align Left Center Align Right Justify Text direction from left to right Text direction from right to leftLinks Link Unlink AnchorInsert Image Flash Table Insert Horizontal Line Smiley Insert Special Character Insert Page Break for Printing IFrameStylesStylesStylesFormatFormatFontFontSizeSizeColors Text Color  Background Color Tools Maximize Show Blocksabout About CKEditorPress ALT 0 for helpElements path