Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <section>
  <h2>9 button types</h2>
  <p>Unified modern style, visual differences reinforce purpose.</p>
  <p>Keyboard, mouse & touch ready.</p>
  <p><b>Ready to customize</b></p>
</section>

<article class="fluid-flex">
  <button>Default</button>
  <input type="button" value="<input>"/>
  <button>
    <svg viewBox="0 0 24 24" stroke="currentColor" width="24" height="24">
      <path d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
    </svg>
    Icon
  </button>
  <button type="submit">Submit</button>
  <button type="button">Type Button</button>
  <button type="reset">Reset</button>
  <button disabled>Disabled</button>
  <button class="btn-custom">Custom</button>
  <input type="file">
</article>

<section>
  <h4>When inside a <code>&#60;form&#62;</code></h4>
  <p><span class="red-squigly">Untyped buttons</span> visually match their new contextual default of type submit.</p>
</section>

<form action="" class="fluid-flex">
  <button>Default <span data-icon="cloud"></span></button>
  <input type="button" value="<input>"/>
  <button type="submit">Submit</button>
  <button type="button">Type Button</button>
  <button type="reset">Reset</button>
  <button disabled>Disabled</button>
  <button class="btn-custom btn-large" type="button">Large Custom</button>
</form>

              
            
!

CSS

              
                @import "https://unpkg.com/open-props";
@import "https://unpkg.com/open-props/normalize.min.css";
@import "https://unpkg.com/open-props/buttons.min.css"; 

.btn-custom {
  --_bg: linear-gradient(var(--indigo-5), var(--indigo-7));
  --_border: var(--indigo-6);
  --_text: var(--indigo-0);
  --_ink-shadow: 0 1px 0 var(--indigo-9);
}

.btn-large {
  --_size: var(--font-size-4);
}

[data-icon="cloud"] {
  --icon-cloud: url("https://api.iconify.design/mdi:apple-icloud.svg") center / contain no-repeat;
  -webkit-mask: var(--icon-cloud);
  background: var(--gradient-30);
  inline-size: 2ch;
  block-size: 2ch;
  filter: drop-shadow(var(--_ink-shadow));
}





















body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-5);
  padding: var(--size-5);
}

form {
  background: var(--surface-2);
  border: var(--border-size-1) solid var(--surface-3);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
}

.fluid-flex {
  display: flex;
  flex-wrap: wrap;
  place-content: center;
  align-items: flex-start;
  padding: var(--size-5);
  gap: var(--size-5);
}

section {
  display: grid;
  gap: var(--size-2);
  text-align: center;
}

section > p {
  font-size: var(--font-size-1);
}

.red-squigly {
  text-decoration: red underline wavy;
}

              
            
!

JS

              
                  
              
            
!
999px

Console