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.


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.


                <!-- Appears on Tiny Blueprint ( in articles:
 - Add placeholder text to TinyMCE-->
<div class="editor-wrap" id="editor-wrap">
  <div class="editor-content" id="editor-content"></div>
  <div class="editor-toolbar" id="editor-toolbar"></div>


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

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

/* The editor wrap element that we use to encapsulate the editor */
.editor-wrap {
  border: 1px solid #ccc;
  padding: 0 0.5rem;
  position: relative;
  border-radius: 4px;
  transition: box-shadow 0.15s;
  padding-bottom: 0;

.editor-wrap.focused {
  box-shadow: 0 0 0 3px rgba(28, 108, 161, 0.08) inset;

/* The element that turns into a TinyMCE editor */
.editor-content {
  transition: min-height 0.25s, padding-bottom 0.25s;
  min-height: 0;
  outline: none;

/* Set the minimum height and make space for the toolbar */
.editor-wrap.focused .editor-content {
  min-height: 140px;
  padding-bottom: 40px;

/* The toolbar is absolute positioned to better support a smooth slide in/out. */
/* Without it the toolbar causes the height to jump when the toolbar toggles */
.editor-toolbar {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  opacity: 0;
  transition: opacity 0.1s;
  transition-delay: 0.15s;

.editor-wrap.focused .editor-toolbar {
  opacity: 1;

/* Below is the content styles, in this case they are global */
/* and not namespaced to `.editor-content` */
a:link {
  color: blue;
a:visited {
  color: purple;
a:hover {
  color: green;
a:active {
  color: red;

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

h2 {
  font-size: 1.5rem;
  font-weight: strong;

h3 {
  font-size: 1rem;
  font-weight: strong;

hr {
  margin: 1.5rem 0;
  padding: 0.5rem 0;
  border: 0;

hr::after {
  content: "";
  display: block;
  border-width: 0 0 1px 0;
  border-color: #ccc;
  border-style: solid;

img {
  max-width: 100%;
  height: auto;



  selector: "#editor-content",
  plugins: "emoticons hr image link lists charmap table",
  toolbar: "formatgroup paragraphgroup insertgroup",
  placeholder: "Ask a question or post an update...",
  menubar: false,
  skin: "naked",
  icons: "thin",

  // Enable inline mode
  inline: true,

  // Render the toolbar in this container.
  fixed_toolbar_container: "#editor-toolbar",

  // Makes menus move upwards
  toolbar_location: "bottom",

  // Remove the manual image resizing as we're using percentage widths
  object_resizing: false,

  // Hide the right click context menus
  contextmenu: false,

  // Create three custom toolbar groups
  toolbar_groups: {
    formatgroup: {
      icon: "format",
      tooltip: "Formatting",
        "bold italic underline strikethrough | forecolor backcolor | superscript subscript | removeformat"
    paragraphgroup: {
      icon: "paragraph",
      tooltip: "Paragraph format",
        "h1 h2 h3 | bullist numlist | alignleft aligncenter alignright | indent outdent"
    insertgroup: {
      icon: "plus",
      tooltip: "Insert",
      items: "link image emoticons charmap hr"

  // On mobile, toolbar_mode is sliding by default which is not compatible
  // with toolbar_groups. Therefore we explicitly set toolbar_mode to floating
  // on mobile and touch devices.
  mobile: {
    toolbar_mode: "floating"

  setup: (editor) => {
    // Apply a custom class to the wrapper element when the editor gets focus
    editor.on("focus", () => {

    // Remove the custom class when the editor loses focus
    editor.on("blur", () => {

    // Register a custom context toolbar for images
    editor.ui.registry.addContextToolbar("editimage", {
      predicate: (node) => {
        return node.nodeName.toLowerCase() === "img";
      items: "editimage removeimage",
      position: "node",
      scope: "node"

    // Register a custom edit image button
    editor.ui.registry.addButton("editimage", {
      icon: "edit-block",
      onAction: () => {
        // Display the image dialog

    // Register a custom remove image button
    editor.ui.registry.addButton("removeimage", {
      icon: "remove",
      onAction: () => {
        // Get the currently selected content (called "node") and delete it.
        const node = tinymce.activeEditor.selection.getNode();