Javascriptajax.com

Bootstrap List Class

Introduction

List group is a effective and convenient element that is located in Bootstrap 4. The component is used for showing a variety or 'list' material. The list group objects can certainly be changed and enhanced to maintain just about any kind of information just within together with a couple of options accessible for customization inside of the list itself. These kinds of list groups are able to also be used for site navigation along with the use of the appropriate modifier class.

In Bootstrap 4, the Bootstrap List Button is a element that designs the unordered lists in a particular way since it paves the way for making custom-made material inside complex lists free from needing to worry about the performance trouble ( due to the fact that the language looks after that by itself). ( find more)

Options of Bootstrap List Template:

Displayed here are the properties which are attainable inside of the list group component in Bootstrap 4:

• Unordered list: The absolute most essential style of list group that you may set up in Bootstrap 4 is an unordered list that has a number of things with the proper classes. You are able to built upon it with the other possibilities which are accessible in the component.

• Active items: You can certainly pointed out the present active pick by just adding the

.active
order to a
.list-group-item
This is useful for if you wish to produce a list of items that is able for clicking.

• Disabled stuffs: You have the ability to as well de-highlight a list material to get it show up as even though it has been disabled. You just simply have to incorporate the

.disabled
extension to the
.list-group-item
for accomplishing this.

• Hyper-links and Buttons: Using the buttons tag, you are able to easily create an actionable object within the Bootstrap List Class which in turn means that you will be able to include hover, active, and disabled states to these kinds of elements with making use of the

.list-group-item-action
feature. { You can divide these types of pseudo-classes from the remaining classes in order to assure that the non-interactive features in your code like
<div>
or
<li>
are not clickable or workable too. It is advised that you do certainly not use the standard button classes such as
.btn
here.

• Contextual classes: This is one more awesome feature that becomes part of the list group element which permits you to style each and every list object using a specific color and background. These are particularly handy for feature specific items or classifying all of them according to color-'s code.

• Badges: You can at the same time include badges to a list item to show the unread counts, activity on the thing, and allow additional active functions with installing additional utilities. ( read this)

Lets see a number of good examples

General example

The most common list group is an unordered list with list pieces and the proper classes. Build upon it by using the selections that follow, or else with your specific CSS as wished.

Basic example

<ul class="list-group">
  <li class="list-group-item">Cras justo odio</li>
  <li class="list-group-item">Dapibus ac facilisis in</li>
  <li class="list-group-item">Morbi leo risus</li>
  <li class="list-group-item">Porta ac consectetur ac</li>
  <li class="list-group-item">Vestibulum at eros</li>
</ul>

Active items

Put in a

.active
to a
.list-group-item
to identify the existing active variety.

Active  things
<ul class="list-group">
  <li class="list-group-item active">Cras justo odio</li>
  <li class="list-group-item">Dapibus ac facilisis in</li>
  <li class="list-group-item">Morbi leo risus</li>
  <li class="list-group-item">Porta ac consectetur ac</li>
  <li class="list-group-item">Vestibulum at eros</li>
</ul>

Disabled items

Add in

.disabled
to a
.list-group-item
to get it show up disabled. Bear in mind that a number of features with will certainly as well expect custom JavaScript to entirely turn off their click on occasions (e.g., web links).

Disabled  objects
<ul class="list-group">
  <li class="list-group-item disabled">Cras justo odio</li>
  <li class="list-group-item">Dapibus ac facilisis in</li>
  <li class="list-group-item">Morbi leo risus</li>
  <li class="list-group-item">Porta ac consectetur ac</li>
  <li class="list-group-item">Vestibulum at eros</li>
</ul>

Urls and buttons

Work with

<a>
or
<button>
to create actionable list group objects with hover, disabled, and active states by adding in
.list-group-item-action
We split up these kinds of pseudo-classes to make certain list groups constructed from non-interactive components (like
<li>
or
<div>
do not supply a click or tap affordance.

Don't forget to not utilize the usual

.btn
classes here.

 Hyper-links and buttons
<div class="list-group">
  <a href="#" class="list-group-item active">
    Cras justo odio
  </a>
  <a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
  <a href="#" class="list-group-item list-group-item-action">Morbi leo risus</a>
  <a href="#" class="list-group-item list-group-item-action">Porta ac consectetur ac</a>
  <a href="#" class="list-group-item list-group-item-action disabled">Vestibulum at eros</a>
</div>

By using

<button>
you can as well work with the
disabled
feature in place of
.disabled
the class. Unfortunately,
<a>
do not support the disabled attribute.

 Connecting buttons
<div class="list-group">
  <button type="button" class="list-group-item list-group-item-action active">
    Cras justo odio
  </button>
  <button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
  <button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
  <button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
  <button type="button" class="list-group-item list-group-item-action" disabled>Vestibulum at eros</button>
</div>

Contextual classes

Use contextual classes to mode list objects with a stateful background along with color option.

Contextual classes
<ul class="list-group">
  <li class="list-group-item">Dapibus ac facilisis in</li>
  <li class="list-group-item list-group-item-success">Dapibus ac facilisis in</li>
  <li class="list-group-item list-group-item-info">Cras sit amet nibh libero</li>
  <li class="list-group-item list-group-item-warning">Porta ac consectetur ac</li>
  <li class="list-group-item list-group-item-danger">Vestibulum at eros</li>
</ul>

Contextual classes equally do the job with

.list-group-item-action
Keep in mind the inclusion of the hover looks here not present in the previous case. At the same time supported is the
.active
implement it to reveal an active selection on a contextual list group material.

Contextual list
<div class="list-group">
  <a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
  <a href="#" class="list-group-item list-group-item-action list-group-item-success">Dapibus ac facilisis in</a>
  <a href="#" class="list-group-item list-group-item-action list-group-item-info">Cras sit amet nibh libero</a>
  <a href="#" class="list-group-item list-group-item-action list-group-item-warning">Porta ac consectetur ac</a>
  <a href="#" class="list-group-item list-group-item-action list-group-item-danger">Vestibulum at eros</a>
</div>

Sharing meaning toward assistive systems.

Using color option to bring in meaning just presents a graphical signal, which in turn will certainly not be shown to operators of assistive technological innovations -- for example, display screen readers. Make sure that info shown with the color option is either clear from the content in itself (e.g. the visible content), or is provided via different solutions, such as extra text covered with the

.sr-only
class.

Utilizing badges

Include badges to any sort of list group object to show unread totals, activity, and much more using some utilities. Take note of the justify-content-between utility class and the badge's location.

 Using badges
<ul class="list-group">
  <li class="list-group-item justify-content-between">
    Cras justo odio
    <span class="badge badge-default badge-pill">14</span>
  </li>
  <li class="list-group-item justify-content-between">
    Dapibus ac facilisis in
    <span class="badge badge-default badge-pill">2</span>
  </li>
  <li class="list-group-item justify-content-between">
    Morbi leo risus
    <span class="badge badge-default badge-pill">1</span>
  </li>
</ul>

Customized material

Add almost any kind of HTML inside, even for linked list groups just like the one listed below, with the aid of flexbox utilities.

 Custom-made  web content
<div class="list-group">
  <a href="#" class="list-group-item list-group-item-action flex-column align-items-start active">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small>3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small>Donec id elit non mi porta.</small>
  </a>
  <a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small class="text-muted">3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small class="text-muted">Donec id elit non mi porta.</small>
  </a>
  <a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small class="text-muted">3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small class="text-muted">Donec id elit non mi porta.</small>
  </a>
</div>

Final thoughts

Overall, list group is a effective and robust element in Bootstrap 4 that allows you to set up an unordered list extra coordinated, interactive, and responsive with no compromising on the appearance as well as layout of the list items themselves.

Check a couple of online video information relating to Bootstrap list:

Related topics:

Bootstrap list official documents

Bootstrap list official documentation

Bootstrap list tutorial

Bootstrap list tutorial

Bootstrap list concern

Bootstrap list  trouble