Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<div class="dx-viewport demo-container">
    <div class="html-editor">
        <h2>
            <img src="https://js.devexpress.com/Demos/WidgetsGallery/JSDemos/images/widgets/HtmlEditor.svg" alt="HtmlEditor">
            Formatted Text Editor (HTML Editor)
        </h2>
        <br>
        <p>DevExtreme JavaScript HTML Editor is a client-side WYSIWYG text editor that allows its users to format textual and visual content and store it as HTML or Markdown.</p>
        <p>Supported features:</p>
        <ul>
            <li>Inline formats:
                <ul>
                    <li><strong>Bold</strong>, <em>italic</em>, <s>strikethrough</s> text formatting</li>
                    <li>Font, size, color changes (HTML only)</li>
                </ul>
            </li>
            <li>Block formats:
                <ul>
                    <li>Headers</li>
                    <li>Text alignment</li>
                    <li>Lists (ordered and unordered)</li>
                    <li>Code blocks</li>
                    <li>Quotes</li>
                </ul>
            </li>
            <li>Custom formats</li>
            <li>HTML and Markdown support</li>
            <li>Mail-merge placeholders (for example, %username%)</li>
            <li>Adaptive toolbar for working images, links, and color formats</li>
            <li>Insert images as a link or base64 (drag and drop images to convert them to base64)</li>
            <li>Copy-paste rich content (unsupported formats are removed)</li>
            <li>Tables support</li>
        </ul>
        <br>
        <p>Supported frameworks and libraries</p>
        <table>
            <tr>
                <td><strong>jQuery</strong></td>
                <td style="text-align: right;">v2.1 - v2.2 and v3.x</td>
            </tr>
            <tr>
                <td><strong>Angular</strong></td>
                <td style="text-align: right;">v7.0.x - v10.0.x</td>
            </tr>
            <tr>
                <td><strong>React</strong></td>
                <td style="text-align: right;">v16.2+</td>
            </tr>
            <tr>
                <td><strong>Vue</strong></td>
                <td style="text-align: right;">v2.6.3+</td>
            </tr>
        </table>
    </div>
    <div class="options">
        <div class="caption">Options</div>
        <div class="option">
            <div id="multiline"></div>
        </div>
    </div>
</div>

              
            
!

CSS

              
                .dx-htmleditor-content img {
    vertical-align: middle;
    padding-right: 10px;
}

.dx-htmleditor-content table {
    width: 50%;
}

.options {
    padding: 20px;
    background-color: rgba(191, 191, 191, 0.15);
    margin-top: 20px;
}

.caption {
    font-size: 18px;
    font-weight: 500;
}

.option {
    margin-top: 10px;
}

              
            
!

JS

              
                $(function () {
  const Clipboard = DevExpress.Quill.import("modules/clipboard");
  class ExtendedClipboard extends Clipboard {
    constructor(quill, options) {
      quill.root.addEventListener("paste", (args) => {
        console.log("custom_paste");
        // cancel on demand;
        args.preventDefault();
      });
      super(quill, options);
      console.log("create_clipboard");
    }
  }

  const Uploader = DevExpress.Quill.import("modules/uploader");
  class ExtendedUploader extends Uploader {
    constructor(quill, options) {
      quill.root.addEventListener("drop", (args) => {
        console.log("custom_drop");
        // cancel on demand;
        args.stopImmediatePropagation();
        args.preventDefault();
      });
      super(quill, options);
      console.log("create_uploader");
    }
  }
  DevExpress.Quill.register(
    {
      "modules/clipboard": ExtendedClipboard,
      "modules/uploader": ExtendedUploader
    },
    true
  );

  var editor = $(".html-editor")
    .dxHtmlEditor({
      height: 725,
      
      toolbar: {
        items: [
          "undo",
          "redo",
          "separator",
          {
            name: "size",
            acceptedValues: [
              "8pt",
              "10pt",
              "12pt",
              "14pt",
              "18pt",
              "24pt",
              "36pt"
            ]
          },
          {
            name: "font",
            acceptedValues: [
              "Arial",
              "Courier New",
              "Georgia",
              "Impact",
              "Lucida Console",
              "Tahoma",
              "Times New Roman",
              "Verdana"
            ]
          },
          "separator",
          "bold",
          "italic",
          "strike",
          "underline",
          "separator",
          "alignLeft",
          "alignCenter",
          "alignRight",
          "alignJustify",
          "separator",
          "orderedList",
          "bulletList",
          "separator",
          {
            name: "header",
            acceptedValues: [false, 1, 2, 3, 4, 5]
          },
          "separator",
          "color",
          "background",
          "separator",
          "link",
          "image",
          "separator",
          "clear",
          "codeBlock",
          "blockquote",
          "separator",
          "insertTable",
          "deleteTable",
          "insertRowAbove",
          "insertRowBelow",
          "deleteRow",
          "insertColumnLeft",
          "insertColumnRight",
          "deleteColumn"
        ]
      },
      mediaResizing: {
        enabled: true
      }
    })
    .dxHtmlEditor("instance");

  $("#multiline").dxCheckBox({
    text: "Multiline toolbar",
    value: true,
    onValueChanged: function (e) {
      editor.option("toolbar.multiline", e.value);
    }
  });
});

              
            
!
999px

Console