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.


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.


      class="mx-auto max-w-4xl bg-gray-200 h-screen"
      x-data="{ tabs: [
        { id: 1, title: 'Tab 1', active: true },
        { id: 2, title: 'Tab 2', active: false },
        { id: 3, title: 'Tab 3', active: false },
      ], activeTab: 1 }"
  <nav class="p-4 bg-indigo-700 text-indigo-100">
    <div>Alpine Tabs</div>
    <div class="text-xs text-indigo-400 font-thin">Alpine.js 3 + TailwindCSS 2</div>

  <section class="flex flex-wrap p-4">
    <!-- Tabs -->
    <nav class="relative flex w-full overflow-hidden z-0 rounded-t-lg shadow" aria-label="Tabs">
        <template x-for="(tab, ix) in tabs" :key="">
                :class=" ? 'bg-white' : 'bg-gray-100'"
                class="group relative min-w-0 flex-1 overflow-hidden py-4 px-4 text-center hover:bg-gray-50 focus:z-10"
                :aria-current=" ? 'page' : 'undefined'"
                @click.prevent="tabs.forEach(tab => = false); tabs[ix].active = true"
                <span x-text="tab.title" :class=" ? 'text-black' : 'text-gray-800'"></span>
                <span aria-hidden="true" :class=" ? 'bg-green-600' : 'bg-transparent'" class="absolute inset-x-0 bottom-0 h-1"></span>
    <div class="flex w-full bg-white shadow">
      <section class="space-y-4 p-2" x-show="tabs.find(tab => === 1).active">
        <h2>Tab 1 content</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus accusantium ad beatae blanditiis consequuntur cum dignissimos doloribus dolorum, ducimus eius laudantium minus saepe voluptatem? Iste nesciunt quia quis tempora temporibus.</p>

      <section class="space-y-4 p-2" x-show="tabs.find(tab => === 2).active">
        <h2>Tab 2 content</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet, animi assumenda blanditiis doloremque, iste maiores molestiae omnis placeat praesentium provident quam quos suscipit tempora tenetur totam, veniam vitae? Id, quaerat?</p>

      <section class="space-y-4 p-2" x-show="tabs.find(tab => === 3).active">
        <h2>Tab 3 content</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab ad, alias eius est hic impedit inventore magni minima nulla numquam odit pariatur quidem tenetur. Alias consectetur corporis perspiciatis repudiandae tempora.</p>



                /* CSS handled by Tailwind 🚀 */


                /* what js? */