HTML Gallery

Bootstrap List Style

Overview

List group is a great and versatile element which is spotted in Bootstrap 4. The component is applied for displaying a variety or 'list' web content. The list group materials can be changed and enhanced to promote almost any kind of information within just through a couple of opportunities accessible for modification within the list itself. These list groups can as well be operated for site navigation together with making use of the suitable modifier class.

In Bootstrap 4, the Bootstrap List Style is a element that forms the unordered lists in a special approach considering that it paves the way for developing custom-made web content inside structure lists free from needing to worry about the performance complication (since the language deals with that on its own). ( useful source)

Possibilities of Bootstrap List Group:

Displayed below are the specialities which are easily available just within the list group element in Bootstrap 4:

• Unordered list: Probably the most simple type of list group that you can easily develop in Bootstrap 4 is an unordered list that has a number of elements with the proper classes. You can easily built upon it by using the various solutions that are accessible in the element.

• Active materials: You can surely focus on the current active pick via simply adding the

.active
direction to a
.list-group-item
This is helpful for when you desire to generate a list of objects that is clickable.

• Disabled materials: You can certainly additionally de-highlight a list stuff to get it appear as even though it has been disabled. You simply will have to put in the

.disabled
extension to the
.list-group-item
for doing so.

• Hyper-links and Buttons: Through the buttons tag, you have the ability to conveniently develop an workable item within the Bootstrap List Template what means that you are going to have the capacity to put in hover, active, and disabled states to all of these objects with making use of the

.list-group-item-action
option. { You may disconnect these kinds of pseudo-classes from the remaining classes in order to make sure that the non-interactive components in your code such as
<div>
or
<li>
are actionable or not clickable as well. It is recommended that you do not actually apply the common button classes i.e
.btn
here.

• Contextual classes: This is another nifty capability that is part of the list group element that enables you to design each list element using a specific color and background. These are especially useful for highlighting special items as well as grouping all of them according to color-'s code.

• Badges: You can at the same time put in badges to a list material to present the unread counts, activity on the object, and make it possible for some other involved features through making use of some other utilities. ( more hints)

Let us look at several cases

General standard

Easily the most basic list group is an unordered list plus list elements and the suitable classes. Build on it together with the approaches that follow, or else through your own 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 elements

Enhance a

.active
to a
.list-group-item
to show the current active selection.

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 things

Provide

.disabled
to a
.list-group-item
to make it appear disabled. Bear in mind that a number of elements with will definitely likewise expect custom-made JavaScript to fully eliminate their select situations (e.g., web links).

Disabled items
<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>

Hyperlinks and switches

Operate

<a>
as well as
<button>
to build workable list group things having hover, disabled, and active states simply by putting
.list-group-item-action
We split up these pseudo-classes to make sure list groups made of non-interactive elements (like
<li>
or even
<div>
don't produce a click on as well as tap affordance.

Ensure to not utilize the common

.btn
classes here.

 Url links and  switches
<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

<button>
you can as well make use of the
disabled
feature as opposed to
.disabled
the class. Unfortunately,
<a>
do not support the disabled feature.

 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 form list items by having a stateful background along with color tone.

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 in addition do work with

.list-group-item-action
Consider the accession of the hover designs here not present in the last case. At the same time supported is the
.active
implement it to identify an active selection on a contextual list group object.

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 in order to assistive systems.

Applying color option to add in indicating just brings a visional signifier, which will certainly not be revealed to users of assistive technologies -- for example, screen readers. Make certain that information marked with the color option is either evident directly from the web content itself (e.g. the exposed words), or is featured with alternate means, such as supplementary text covered up having the

.sr-only
class.

Using badges

Provide badges to any type of list group item to reveal unread results, activity, and a lot more with the aid of various utilities. Keep in mind the justify-content-between utility class and the badge's location.

 Having 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>

Custom-made material

Add pretty much any HTML in, even for connected list groups similar to the one listed below, through flexbox utilities.

Custom  material
<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 robust and helpful component in Bootstrap 4 that enables you to get an unordered list more organised, interactive, and responsive without any giving in on the visual aspect as well as layout of the list things themselves.

Look at some on-line video guide about Bootstrap list:

Linked topics:

Bootstrap list formal documentation

Bootstrap list  formal  records

Bootstrap list article

Bootstrap list  training

Bootstrap list issue

Bootstrap list  difficulty