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.


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.


                <div id="app">
    <vue-tab label="first">
      <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit, corporis!</div>
    <vue-tab label="second">
      <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit, corporis! Lorem ipsum dolor, sit amet consectetur adipisicing elit. Asperiores voluptatum, dolore provident sequi incidunt mollitia odit minus facere itaque reprehenderit minima aperiam nihil numquam veniam porro assumenda doloribus quidem id!</div>
    <vue-tab label="third" :active="true">
      <div>Далеко-далеко за словесными горами в стране гласных, и согласных живут рыбные тексты. Жаренные свой гор деревни о всеми, бросил власти одна коварный имени, над, несколько путь которой щеке предложения залетают вершину первую.</div>


  box-sizing: border-box

  font-family: sans-serif
  padding: 0 15px
  background: #f4f4f4
  margin: 50px auto
  max-width: 700px
  background: #fff
  box-shadow: 0 3px 16px rgba(#000, .1)
    display: flex
    height: 40px
    border-bottom: solid 1px #e9e9e9
    padding: 0 14px
    display: flex
    align-items: center
    color: rgba(#000, .7)
    font-size: 13px
    text-transform: uppercase
    cursor: pointer
      color: dodgerblue
    position: relative
    overflow: hidden
    will-change: height
    transition: height .4s cubic-bezier(.86,0,.07,1)
    display: flex
    justify-content: flex-start
    align-items: flex-start
    will-change: transform
    transition: transform .4s cubic-bezier(.86,0,.07,1)
    flex: 1 0 100%
    width: 100%
    padding: 16px


Vue.component('vue-tabs', {
  template: `<div class="tabs">
    <div class="tabs__list">
        :class="{'tabs__tab_active': i === active}"
        v-for="(label, i) in Tabs.labels"
    <div class="tabs__container" ref="container">
      <div class="tabs__wrapper" ref="wrapper">
        <slot />
  computed: {
    active() {
  data() {
    return {
      Tabs: {
        labels: [],
        items: [],
        active: 0
  methods: {
    setHeight() {
      const el = this.Tabs.items[]
      const height = el.scrollHeight
      this.$ = height + 'px'
    scrollWrapper() {
      const {wrapper} = this.$refs
      const offset = 100 * = `translate3d(-${offset}%, 0, 0)`
    changeTab(i) { = i
  provide() {
    return {
      Tabs: this.Tabs
  mounted() {
    this.debounce = _.debounce(this.setHeight, 50)
    window.addEventListener('resize', this.debounce)
  beforeDestroy() {
    window.removeEventListener('resize', this.debounce)

Vue.component('vue-tab', {
  template: `<div class="tabs__content"><slot /></div>`,
  props: ['label', 'active'],
  inject: ['Tabs'],
  created() {
    const length = this.Tabs.labels.push(this.label)
    if ( { = length - 1
  mounted() {

new Vue({
  el: '#app'