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="p-12">
  <!-- Single FAQ -->
  <div x-data="{ open: false }">
    <button @click="open = !open" class="text-lg text-slate-900 px-4 py-2 border-2 border-slate-900 w-full text-left">
       <span x-text="open ? '➖': '➕'"></span> What is Lorem ipsum ?
    </button>
    <div x-show="open === true" x-transition class="border-2 border-slate-900 border-t-0 px-4 py-2 bg-slate-900 text-slate-200">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum in asperiores aut eos nihil vitae ab at tenetur enim repellendus nemo aliquam odio provident adipisci quae laboriosam commodi ea totam, impedit tempora hic. Velit non aperiam laudantium et, qui delectus, maxime exercitationem fuga, error atque assumenda? Officia praesentium quod tenetur?
    </div>
  </div>
  
  <!-- Open Multiple Faq in a group-->
  <div>
     <h1 class="text-slate-900 font-bold text-xl my-4">Open Multiple Faq in a group</h1>
    <div x-data="{ open: false }">
    <button @click="open = !open" class="text-lg text-slate-900 px-4 py-2 border-2 border-slate-900 w-full text-left">
       <span x-text="open ? '➖': '➕'"></span> What is Lorem ipsum ?
    </button>
    <div x-show="open === true" x-transition class="border-2 border-slate-900 border-t-0 px-4 py-2 bg-slate-900 text-slate-200">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum in asperiores aut eos nihil vitae ab at tenetur enim repellendus nemo aliquam odio provident adipisci quae laboriosam commodi ea totam, impedit tempora hic. Velit non aperiam laudantium et, qui delectus, maxime exercitationem fuga, error atque assumenda? Officia praesentium quod tenetur?
    </div>
  </div>
    <br />
    <div x-data="{ open: false }">
    <button @click="open = !open" class="text-lg text-slate-900 px-4 py-2 border-2 border-slate-900 w-full text-left">
       <span x-text="open ? '➖': '➕'"></span> What is Lorem ipsum ?
    </button>
    <div x-show="open === true" x-transition class="border-2 border-slate-900 border-t-0 px-4 py-2 bg-slate-900 text-slate-200">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum in asperiores aut eos nihil vitae ab at tenetur enim repellendus nemo aliquam odio provident adipisci quae laboriosam commodi ea totam, impedit tempora hic. Velit non aperiam laudantium et, qui delectus, maxime exercitationem fuga, error atque assumenda? Officia praesentium quod tenetur?
    </div>
  </div>
  </div>
  
  <!-- Can Open Only One at a time -->
  <div x-data="{ active: 1 }">
     <h1 class="text-slate-900 font-bold text-xl my-4">Can Open Only One at a time</h1>
      <div>
        <button @click="active = 1" class="text-lg text-slate-900 px-4 py-2 border-2 border-slate-900 w-full text-left">
           <span x-text="active === 1 ? '➖': '➕'"></span> What is Lorem ipsum ?
        </button>
        <div x-show="active === 1" x-transition.duration.300ms class="border-2 border-slate-900 border-t-0 px-4 py-2 bg-slate-900 text-slate-200">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum in asperiores aut eos nihil vitae ab at tenetur enim repellendus nemo aliquam odio provident adipisci quae laboriosam commodi ea totam, impedit tempora hic. Velit non aperiam laudantium et, qui delectus, maxime exercitationem fuga, error atque assumenda? Officia praesentium quod tenetur?
        </div>
      </div>
      <br />
      <div>
        <button @click="active = 2" class="text-lg text-slate-900 px-4 py-2 border-2 border-slate-900 w-full text-left">
           <span x-text="active === 2 ? '➖': '➕'"></span> What is Lorem ipsum ?
        </button>
        <div x-show="active === 2" x-transition.duration.300ms class="border-2 border-slate-900 border-t-0 px-4 py-2 bg-slate-900 text-slate-200">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum in asperiores aut eos nihil vitae ab at tenetur enim repellendus nemo aliquam odio provident adipisci quae laboriosam commodi ea totam, impedit tempora hic. Velit non aperiam laudantium et, qui delectus, maxime exercitationem fuga, error atque assumenda? Officia praesentium quod tenetur?
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                import * as tailwindcss from "https://cdn.skypack.dev/tailwindcss@3.1.8";
import * as tailwindcss from "https://cdn.skypack.dev/tailwindcss@3.1.8";

              
            
!
999px

Console