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 id="app" class="text-black antialiased flex flex-col h-screen">
  <!-- top nav -->
  <div class="h-16 flex items-center border-b border-gray-400 px-2">
    <div class="flex-1 font-bold px-4">
      App name
    </div>
    <button class="px-4" @click="currentTab = 'Newsfeed'">
      Newsfeed
    </button>
    <button class="px-4" @click="currentTab = 'Explore'">
      Explore
    </button>
    <button class="px-4" @click="currentTab = 'Notifications'">
      Notifications
    </button>
    <button class="px-4" @click="currentTab = 'Profile'">
      Profile
    </button>
  </div>
  <!-- header -->
  <div class="px-6 py-3 text-3xl font-bold" v-if="currentTab !== 'Profile'">
    {{currentTab}}
  </div>
  <!-- content: Newsfeed -->
  <div class="flex-1 overflow-scroll px-3" v-if="currentTab === 'Newsfeed'">
    <!-- post -->
    <div class="px-3 pt-6">
      <div class="flex items-start">
        <div class="w-12 h-12 bg-indigo-300 mr-4"></div>
        <div class="flex-1">
          <div class="w-2/3 h-3 bg-indigo-300"></div>
          <div class="w-2/5 h-3 bg-indigo-300 mt-2"></div>
        </div>
      </div>
      <div class="mt-4 bg-indigo-300 w-full" style="height: 200px;"></div>
    </div>
    <!-- post -->
    <div class="px-3 pt-6">
      <div class="flex items-start">
        <div class="w-12 h-12 bg-indigo-300 mr-4"></div>
        <div class="flex-1">
          <div class="w-2/3 h-3 bg-indigo-300"></div>
          <div class="w-2/5 h-3 bg-indigo-300 mt-2"></div>
        </div>
      </div>
      <div class="mt-4 bg-indigo-300 w-full" style="height: 200px;"></div>
    </div>
  </div>
  <!-- content: Explore -->
  <div class="flex-1 overflow-scroll px-3" v-if="currentTab === 'Explore'">
    <!-- stories -->
    <div class="flex items-center w-full overflow-x-scroll pt-6 pb-4">
      <div class="mr-1 ml-3 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
      <div class="mx-1 h-12 w-12 bg-green-300 rounded-full" style="width: 48px; min-width: 48px;"></div>
    </div>
    <!-- title -->
    <div class="w-2/5 h-3 bg-green-300 ml-3 mt-4"></div>
    <!-- grid -->
    <div class="flex flex-wrap px-2 justify-between pt-6">
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
      <div class="w-1/3 h-32 px-1 py-1">
        <div class="bg-green-300 w-full h-full"></div>
      </div>
    </div>
  </div>
  <!-- content: Notifications -->
  <div class="flex-1 overflow-scroll px-3" v-if="currentTab === 'Notifications'">
    <!-- sections -->
    <div class="flex flex-wrap px-2 justify-between pt-6">
      <div class="w-1/3 px-1 h-4"><div class="bg-blue-300 w-full h-full"></div></div>
      <div class="w-1/3 px-1 h-4"><div class="bg-blue-300 w-full h-full"></div></div>
      <div class="w-1/3 px-1 h-4"><div class="bg-blue-300 w-full h-full"></div></div>
    </div>
    <!-- posts -->
    <div class="mt-4 bg-blue-300 mx-3" style="height: 200px;"></div>
    <div class="mt-4 bg-blue-300 mx-3" style="height: 200px;"></div>
    <div class="mt-4 bg-blue-300 mx-3" style="height: 200px;"></div>
  </div>
  <!-- content: Profile -->
  <div class="flex-1 overflow-scroll px-3" v-if="currentTab === 'Profile'">
    <!-- profile -->
    <div class="flex flex-col items-center px-3 pt-4">
      <div class="w-32 h-32 bg-pink-300 rounded-full "></div>
      <div class="w-48 h-3 bg-pink-300 mt-4"></div>
      <div class="w-32 h-3 bg-pink-300 mt-2"></div>
    </div>
    <!-- log out -->
    <!-- <div class="text-center mt-6">
      <button class="" @click="isUserLoggedIn = false">Log out</button>
    </div> -->
    <!-- sections -->
    <div class="flex flex-wrap px-2 justify-between pt-6">
      <div class="w-1/3 px-1 h-4"><div class="bg-pink-300 w-full h-full"></div></div>
      <div class="w-1/3 px-1 h-4"><div class="bg-pink-300 w-full h-full"></div></div>
      <div class="w-1/3 px-1 h-4"><div class="bg-pink-300 w-full h-full"></div></div>
    </div>
    <!-- posts -->
    <div class="mt-4 bg-pink-300 mx-3" style="height: 200px;"></div>
    <div class="mt-4 bg-pink-300 mx-3" style="height: 200px;"></div>
    <div class="mt-4 bg-pink-300 mx-3" style="height: 200px;"></div>
  </div>
</div>
              
            
!

CSS

              
                input, textarea, button:focus {
  outline: none;
}

input::placeholder {
  color: #cbd5e0;
  opacity: 1;
}
              
            
!

JS

              
                var app = new Vue({
  el: '#app',
  data: {
   currentTab: 'Newsfeed'
  },
  methods: {
    // functions go here
  }
})
              
            
!
999px

Console