Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


                <div class="app">
  <div class="app__counter">
    Loading counter...
  <button class="app__increment">


                .app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #4758D6;
  &__counter {
    margin-bottom: 40px;
    color: #FFF;
    font-size: 80px;
    line-height: 1.2em;
    font-weight: bold;
  &__increment {
    padding: 16px;
    border: 0;
    border-radius: 4px;
    font-size: 36px;
    line-height: 1.2em;
    cursor: pointer;


                // We've already loaded firebase from Google CDN 
// and here just initialize it :
var config = {
  apiKey: "AIzaSyAE-uA-7cqHfHklNumb4KbjPKaU2cwszzs",
  authDomain: "",
  databaseURL: "",
  projectId: "fir-demo-ef13f",
  storageBucket: "",
  messagingSenderId: "551428965639"

// Now let's listen to the value of the counter and write it 
// to the counter DOM element
const counter = document.getElementsByClassName("app__counter")[0];
const counterRef = firebase.database().ref("incremental_counter");
counterRef.on("value", (snapshot) => {
  counter.textContent = snapshot.val();

// Note that we don't update the counter value on the page manually.
// This is where "Realtime" comes into play: 
// the new value will be synced across all the clients (line 18)
const incrementButton = document.getElementsByClassName("app__increment")[0];
incrementButton.addEventListener("click", () => {  
  counterRef.transaction(val => val + 1, (err) => {
    if (err) {
}, false);