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

              
                <div class="device">
  <div class="system-status-bar">
    <time>9:41</time>
  </div>
  <div class="app">
    <nav>
      <svg width="32" height="32" viewBox="6 0 24 24">
        <path fill="currentColor" d="M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"/>
      </svg>
      <svg width="24" height="24" viewBox="0 0 24 24">
        <path fill="currentColor" d="m12 8.89l.94 3.11h2.82l-2.27 1.62l.93 3.01L12 14.79l-2.42 1.84l.93-3.01L8.24 12h2.82L12 8.89M12 2l-2.42 8H2l6.17 4.41L5.83 22L12 17.31L18.18 22l-2.35-7.59L22 10h-7.58L12 2z"/>
      </svg>
    </nav>
    <header>
      <h1>Mt. Rainier</h1>
      <small>14,410 ft</small>
    </header>
    <main>
      <img width="720" src="https://picsum.photos/1024/1024" alt="">
    </main>
    <footer>
      <div class="tab">
        <svg width="24" height="24" viewBox="0 0 24 24">
          <path fill="currentColor" d="M19.8 18.4L14 10.67V6.5l1.35-1.69c.26-.33.03-.81-.39-.81H9.04c-.42 0-.65.48-.39.81L10 6.5v4.17L4.2 18.4c-.49.66-.02 1.6.8 1.6h14c.82 0 1.29-.94.8-1.6z"/>
        </svg>
        <p>Peaks</p>
      </div>
      <div class="tab">
        <svg width="24" height="24" viewBox="0 0 24 24">
          <path fill="currentColor" d="m20.5 3l-.16.03L15 5.1L9 3L3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1l5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"/>
        </svg>
        <p>Map</p>
      </div>
      <div class="tab">
        <svg width="24" height="24" viewBox="0 0 24 24">
          <path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/>
        </svg>
        <p>New Trip</p>
      </div>
      <div class="tab">
        <svg width="24" height="24" viewBox="0 0 24 24">
          <path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z"/>
        </svg>
        <p>Explore</p>
      </div>
      <div class="tab">
        <svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
        <p>My Profile</p>
      </div>
    </footer>
  </div>
  <div class="system-gesture-bar"></div>
</div>
              
            
!

CSS

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

@layer demo {
  .device {
    min-inline-size: 350px;
    display: grid;
    grid-template-rows: 
      [system-status] 3.5rem 
      [primary-nav] 3rem 
      [primary-header] 4rem
      [main] auto
      [footer] 4rem 
      [system-gestures] 2rem
    ;
    grid-template-columns: [fullbleed-start] 1rem [main-start] auto [main-end] 1rem [fullbleed-end];
  }
  
  .device > *,
  .app > * {
    display: grid;
    grid: subgrid / subgrid;
  }
  
  .system-status-bar {
    grid-area: system-status / fullbleed;
    display: grid;
    align-items: center;
  }
  
  .system-status-bar > time {
    grid-area: system-status / main;
    margin-inline: 2rem;
  }
  
  .system-gesture-bar {
    grid-area: system-gestures / fullbleed;
    place-items: center;
  }
  
  .app {
    grid-area: primary-nav / fullbleed-start / system-gestures / fullbleed-end;
  }
  
  .app > nav {
    grid-area: primary-nav / fullbleed;
    align-items: center;
    justify-content: space-between;
  }
  
  .app > nav > svg {
    grid-area: main;
  }
  
  .app > nav > svg:last-of-type {
    justify-self: flex-end;
  }
  
  .app > header {
    grid-area: primary-header / fullbleed;
    grid-template-rows: auto auto;
  }
  
  .app > header > h1 {
    grid-area: 1 / main;
  }
  
  .app > header > small {
    grid-area: 2 / main;
  }
  
  .app > main {
    background: hsl(0 0% 95%);
    grid-area: main / fullbleed;
    overflow: auto;
  }
  
  @media (prefers-color-scheme: dark) {
    .app > main {
      background: black;
    }
  }
  
  .app > main img {
    grid-area: fullbleed;
    max-inline-size: 100%;
    block-size: auto;
  }
  
  .app > footer {
    grid-area: footer / fullbleed;
    grid-template-columns: repeat(5, 1fr);
  }
  
  .tab {
    display: grid;
    gap: .5ch;
    place-content: center;
    place-items: center;
    font-size: .8rem;
  }
}

@layer demo.support {
  * {
    box-sizing: border-box;
    margin: 0;
  }

  html {
    block-size: 100%;
    color-scheme: dark light;
    background: hsl(0 0% 92%);
  }
  
  @media (prefers-color-scheme: dark) {
    html {
      background: hsl(0 0% 15%);
    }
  }

  body {
    min-block-size: 100%;
    font-family: system-ui, sans-serif;

    display: grid;
    place-content: center;
  }
  
  .device {
    inline-size: 50vmin;
    aspect-ratio: 9/16;
    background: Canvas;
    border-radius: 25px;
    box-shadow: var(--shadow-6);
  }
  
  .system-status-bar::after {
    content: "";
    grid-area: 1 / main;
    justify-self: center;
    background: black;
    block-size: 50%;
    inline-size: 25%;
    border-radius: 1e5px;
  }
  
  .system-gesture-bar::after {
    content: "";
    grid-area: 1 / main;
    background: black;
    block-size: 5px;
    inline-size: 40%;
    border-radius: 1e5px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console