Mamod.me

Bootstrap Accordion List

Introduction

Websites are the most excellent place to feature a great concepts as well as attractive information in simple and really cheap method and have them available for the whole world to discover and get familiar with. Will the content you've posted earn reader's passion and attention-- this stuff we can certainly never figure out before you actually get it live to web server. We may however presume with a pretty serious probability of being right the influence of certain elements over the website visitor-- judging either from our unique experience, the excellent methods explained over the web or most generally-- by the manner a web page has an effect on ourselves as long as we're providing it a form during the design process. One thing is sure yet-- huge spaces of plain text are very probable to bore the user and also move the site visitor away-- so what exactly to try when we just require to set this kind of much bigger amount of content-- such as conditions and terms , frequently asked questions, technical options of a goods as well as a service which in turn ought to be uncovered and exact etc. Well that is simply the things the construction process in itself narrows down in the end-- identifying working answers-- and we need to uncover a way working this one out-- feature the content required in appealing and fascinating approach nevertheless it might be 3 web pages plain text prolonged.

A good technique is enclosing the message in to the so called Bootstrap Accordion Table element-- it presents us a powerful way to feature just the subtitles of our text present and clickable on webpage and so basically the whole web content is attainable at all times within a small space-- commonly a single display screen so the site visitor can quickly click on what is essential and have it widened to become familiar with the detailed material. This specific strategy is certainly as well natural and web format due to the fact that small actions need to be taken to continue working with the webpage and in such manner we make the visitor advanced-- somewhat "push the button and see the light flashing" thing.

Exactly how to work with the Bootstrap Accordion Table:

Accordion example

Expand the default collapse behavior to design an Bootstrap Accordion Styles.

Accordion  model

Accordion  model
Accordion example
<div id="accordion" role="tablist" aria-multiselectable="true">
  <div class="card">
    <div class="card-header" role="tab" id="headingOne">
      <h5 class="mb-0">
        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
          Collapsible Group Item #1
        </a>
      </h5>
    </div>

    <div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
      <div class="card-block">
        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
  <div class="card">
    <div class="card-header" role="tab" id="headingTwo">
      <h5 class="mb-0">
        <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
          Collapsible Group Item #2
        </a>
      </h5>
    </div>
    <div id="collapseTwo" class="collapse" role="tabpanel" aria-labelledby="headingTwo">
      <div class="card-block">
        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
  <div class="card">
    <div class="card-header" role="tab" id="headingThree">
      <h5 class="mb-0">
        <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
          Collapsible Group Item #3
        </a>
      </h5>
    </div>
    <div id="collapseThree" class="collapse" role="tabpanel" aria-labelledby="headingThree">
      <div class="card-block">
        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>
</div>

In Bootstrap 4 we possess the fantastic tools for producing an accordion very easy and fast using the newly presented cards elements incorporating just a couple of additional wrapper elements. Listed here is how: To start creating an accordion we first need to have an element to wrap the whole thing into-- provide a

<div>
element and assign it an ID-- something like
id="MyAccordionWrapper"
or so attribute. ( useful reference)

Next it's point to make the accordion panels-- add in a

.card
element, in it-- a
.card-header
to forge the accordion caption. Within the header-- incorporate an original headline such as
h1-- h6
with the
. card-title
class specified and within this kind of heading wrap an
<a>
element to effectively carry the heading of the section. For you to control the collapsing section we are undoubtedly about to create it should certainly have
data-toggle = "collapse"
attribute, its goal should be the ID of the collapsing feature we'll build in a minute similar to
data-target = "long-text-1"
as an example and at last-- to make certain only one accordion element stays spread out at once we should really in addition incorporate a
data-parent
attribute indicating the master wrapper with regard to the accordion in our example it must be
data-parent = "MyAccordionWrapper"

One more good example

 A different  representation
<!DOCTYPE html>
<title>My Example</title>

<!-- Bootstrap 4 alpha CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="sha384-2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj" crossorigin="anonymous">
<style>
body 
padding-top: 1em;
 
</style>
<div class="container-fluid">
    
<div id="faq" role="tablist" aria-multiselectable="true">

<div class="card">
<div class="card-header" role="tab" id="questionOne">
<h5 class="card-title">
<a data-toggle="collapse" data-parent="#faq" href="#answerOne" aria-expanded="false" aria-controls="answerOne">
What if my boots are too big for my feet?
</a>
</h5>
</div>
<div id="answerOne" class="collapse" role="tabcard" aria-labelledby="questionOne">
<div class="card-block">
Stuff your boots with newspaper or tissue.
</div>
</div>
</div>

<div class="card">
<div class="card-header" role="tab" id="questionTwo">
<h5 class="card-title">
<a class="collapsed" data-toggle="collapse" data-parent="#faq" href="#answerTwo" aria-expanded="false" aria-controls="answerTwo">
Can I wear my boots inside?
</a>
</h5>
</div>
<div id="answerTwo" class="collapse" role="tabcard" aria-labelledby="questionTwo">
<div class="card-block">
No. Your mama should've told you about this.
</div>
</div>
</div>

<div class="card">
<div class="card-header" role="tab" id="questionThree">
<h5 class="card-title">
<a class="collapsed" data-toggle="collapse" data-parent="#faq" href="#answerThree" aria-expanded="true" aria-controls="answerThree">
What if my boots get slippery when wet?
</a>
</h5>
</div>
<div id="answerThree" class="collapse in" role="tabcard" aria-labelledby="questionThree">
<div class="card-block">
Keep your boots dry.
</div>
</div>
</div>

</div>

</div>
    
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js" integrity="sha384-THPy051/pYDQGanwU6poAc/hOdQxjnOEXzbT+OuUAFqNqFjL+4IGLBgCJC3ZOShY" crossorigin="anonymous"></script>

<!-- Tether -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/js/tether.min.js" integrity="sha384-Plbmg8JY28KFelvJVai01l8WyZzrYWG825m+cZ0eDDS1f7d/js6ikvy1+X+guPIB" crossorigin="anonymous"></script>

<!-- Bootstrap 4 Alpha JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js" integrity="sha384-VjEeINv9OSwtWFLAtmc4JCtEJXXBub00gtSnszmspDLCtC0I4z4nqz7rEFbIZLLU" crossorigin="anonymous"></script>

<!-- Initialize Bootstrap functionality -->
<script>
// Initialize tooltip component
$(function () 
  $('[data-toggle="tooltip"]').tooltip()
)

// Initialize popover component
$(function () 
  $('[data-toggle="popover"]').popover()
)
</script>

When this is performed it is truly the right moment for setting up the component which in turn is going to stay hidden and maintain the actual material behind the heading. To carry out this we'll wrap a

.card-block
within a
.collapse
component together with an ID attribute-- the same ID we must put serving as a target for the web link within the
.card-title
from above-- for the example it really should be just like
id ="long-text-1"

When this design has been generated you can certainly place either the clear text or else extra wrap your content setting up a bit more complex form. ( more hints)

Expanded web content

Repeating the training from above you can certainly incorporate as many features to your accordion as you want to. And also supposing that you prefer a information feature to show extended-- specify the

.in
or possibly
.show
classes to it baseding upon the Bootstrap 4 build version you're utilizing-- up to Alpha 5 the
.in
class goes and within Alpha 6 it becomes switched out by
.show

Conclusions

So simply speaking that is really the way in which you can generate an absolutely functioning and quite great looking accordion with the Bootstrap 4 framework. Do note it utilizes the card feature and cards do extend the entire zone accessible by default. And so incorporated together with the Bootstrap's grid column features you can quickly build complex pleasing arrangements installing the entire thing inside an element with defined amount of columns width.

Inspect several online video guide relating to Bootstrap Accordion

Linked topics:

Bootstrap accordion official documentation

Bootstrap acoordion  authoritative documentation

How to make a Bootstrap v4 accordion collapse when clicking the whole header div?

How to make a Bootstrap v4 accordion collapse when clicking the whole header div?

GitHub:Collapse Accordion is still using Panels

GitHub:Collapse Accordion is still using Panels