Skip to main content Skip to docs navigation

Accordion Examples

Liander style examples for the accordion component

Accordion - with card

example

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the first item's accordion body.

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the second item's accordion body. Let's imagine this being filled with some actual content.

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.
html
<div class="card" style="width: 22rem;">
  <div class="card-body px-4 py-3">
    <div class="accordion accordion-flush" id="accordionFlushExample1">
      <div class="accordion-item">
        <h2 class="accordion-header">
          <button class="accordion-button collapsed px-0" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne1" aria-expanded="false" aria-controls="flush-collapseOne1">
            Accordion Item #1
          </button>
        </h2>
        <div id="flush-collapseOne1" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample1">
          <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the first item's accordion body.</div>
        </div>
      </div>
      <div class="accordion-item">
        <h2 class="accordion-header">
          <button class="accordion-button collapsed px-0" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo1" aria-expanded="false" aria-controls="flush-collapseTwo1">
            Accordion Item #2
          </button>
        </h2>
        <div id="flush-collapseTwo1" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample1">
          <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the second item's accordion body. Let's imagine this being filled with some actual content.</div>
        </div>
      </div>
      <div class="accordion-item">
        <h2 class="accordion-header">
          <button class="accordion-button collapsed px-0" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseThree1" aria-expanded="false" aria-controls="flush-collapseThree1">
            Accordion Item #3
          </button>
        </h2>
        <div id="flush-collapseThree1" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample1">
          <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div>
        </div>
      </div>
    </div>
  </div>
</div>

Accordion - without card

example

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the first item's accordion body.

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the second item's accordion body. Let's imagine this being filled with some actual content.

Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class within a card. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.
html
<div class="accordion accordion-flush p-3 bg-white rounded-3 rounded-top-start-0" id="accordionFlushExample2">
  <div class="accordion-item">
    <h2 class="accordion-header">
      <button class="accordion-button collapsed px-0 pt-2" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne2" aria-expanded="false" aria-controls="flush-collapseOne2">
        Accordion Item #1
      </button>
    </h2>
    <div id="flush-collapseOne2" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample2">
      <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the first item's accordion body.</div>
    </div>
  </div>
  <div class="accordion-item">
    <h2 class="accordion-header">
      <button class="accordion-button collapsed px-0" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo2" aria-expanded="false" aria-controls="flush-collapseTwo2">
        Accordion Item #2
      </button>
    </h2>
    <div id="flush-collapseTwo2" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample2">
      <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the second item's accordion body. Let's imagine this being filled with some actual content.</div>
    </div>
  </div>
  <div class="accordion-item">
    <h2 class="accordion-header">
      <button class="accordion-button collapsed px-0 pb-1" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseThree2" aria-expanded="false" aria-controls="flush-collapseThree2">
        Accordion Item #3
      </button>
    </h2>
    <div id="flush-collapseThree2" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample2">
      <div class="accordion-body px-0">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class within a card. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div>
    </div>
  </div>
</div>