Contribute to this guideReport an issue

SimpleBox (Creating a Custom Widget) Documentation

This sample demonstrates the Simple Box widget plugin that was created in the Creating a Simple CKEditor 4 Widget tutorial series from the Widget SDK section of the CKEditor 4 Developer's Guide.

The custom widget created in the tutorials lets the users insert a simple box with a title and comment fields into their documents. The widget creates a predefined content structure that is added to the document when the user clicks the dedicated   toolbar button available in the editor instance below. The included dialog window lets users both insert a new widget into the editor and modify an existing one and set some basic properties (width, alignment) for it.

Simple Box is a proof-of-concept plugin that can be downloaded from the repository or created by following the step-by-step tutorial.

Related Features

Get Sample Source Code

  • Simple box widget
    <!doctype html>
    <html lang="en">
      <meta charset="utf-8">
      <meta name="robots" content="noindex, nofollow">
      <title>Simple box widget</title>
      <script src=""></script>
      <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href=&quot;;&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
        CKEDITOR.plugins.addExternal('simplebox', '', 'plugin.js');
        CKEDITOR.replace('editor1', {
          // Add the Simple Box plugin.
          extraPlugins: 'simplebox',
          // Besides editor's main stylesheet load also simplebox styles.
          // In the usual case they can be added to the main stylesheet.
          contentsCss: [
          // Set height to make more content visible.
          height: 500,
          removeButtons: 'PasteFromWord'