Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


    <h1>Template Plugin: Created Date</h1>
    <p>This is an example of the <a href="" target="_blank">template</a> plugin
      in TinyMCE 5 inserting the current date and time when the template is used.</p>
    <p>There are two configuration options - one for the created date (when the template is added to TinyMCE) and
      one for modified date (which updates when the editor is reloaded - i.e. created, saved, and then edited again later.</p>
    <p>Refer to the <a href="" target="_blank">documentation</a> for full
      details, specifically the template_cdate_classes/template_cdate_format and template_mdate_classes/template_mdate_format options.</p>
    <p>Refer to the <a href="" target="_blank">Reference Date/Time formats</a>
      for the tokens to use to configure the <a href="" target="_blank">template_cdate_format</a>
      and <a href="" target="_blank">template_mdate_format</a> options.</p>
    <p>The target of the created/modified date can be configured with the <a href="" target="_blank">template_cdate_classes</a>
      and <a href="" target="_blank">template_mdate_classes</a> options.</p>


                body {
    margin: 2rem 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,

main {
    max-width: 720px;
    margin: auto;

section {
    margin-bottom: 3rem;

h1 {
    font-size: 1.75rem;
    font-weight: bold;

a {
    color: rgb(25, 118, 210);
    font-weight: bold;
    text-decoration: none;

a:hover {
    color: rgb(145, 180, 225);


    selector: 'textarea',
    plugins: 'template',
    toolbar: 'template',
    menubar: false,

    min_height: 380,
    templates: [
            title: 'Created Date example',
            description: 'When this template is inserted in to TinyMCE, the contents of any element with the "created-date" class will have its contents replaced the current time and date.',
            content: '<p><strong>Created: </strong><span class="created-date"><em>[auto-insert created date]</em></span></p>' +
                     '<p>The "[auto-insert created date]" above will be replaced with the current time and date when the template is used.</p>' +
                     '<p>Look at the "template_cdate_format" configuration option in the TinyMCE init call to change the format.</p>'

    template_cdate_classes: "created-date",
    template_cdate_format: "%I:%M %p %A %d %B %Y"