Mamod.me

Bootstrap List View

Overview

List group is a effective and extremely versatile element which is found in Bootstrap 4. The component is taken for displaying a series or 'list' information. The list group things are able to be changed and expanded to maintain almost any sort of information within through some options provided for modification within the list itself. These list groups can surely additionally be employed for site navigation along with the use of the appropriate modifier class.

In Bootstrap 4, the Bootstrap List Item is a component that forms the unordered lists in a specific approach due to the fact that it paves the way for making custom made information within structure lists without needing to worry about the presentation concern ( because the language looks after that on its own). ( read here)

Solutions of Bootstrap List Example:

Provided in this article are the specialities which are accessible within the list group component within Bootstrap 4:

• Unordered list: The absolute most essential kind of list group which you can absolutely generate in Bootstrap 4 is an unordered list that has a collection of elements by having the appropriate classes. You can built upon it by using the other possibilities which are accessible in the element.

• Active materials: You can certainly highlight the present active selection through just simply adding in the

.active
command to a
.list-group-item
This is handy for when you wish to build a list of materials that is able for clicking.

• Disabled materials: You have the ability to additionally de-highlight a list material making it show up as though it has been disabled. You simply need to add the

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

• Urls and Buttons: Using the buttons tag, you are able to simply produce an actionable object inside the Bootstrap List Example which means that you will definitely be able to include hover, active, and disabled states to these kinds of items with using the

.list-group-item-action
opportunity. { You can split these kinds of pseudo-classes from the remaining classes to ensure that the non-interactive elements in your code such as
<div>
or
<li>
are not clickable or workable too. It is recommended that you do certainly not employ the common button classes such as
.btn
here.

• Contextual classes: This is another clever feature that becomes part of the list group element that helps you to style every list item having a definitive color and background. These are mainly handy for emphasize special materials as well as classifying all of them according to color-'s code.

• Badges: You can even provide badges to a list object to present the unread counts, activity on the thing, and allow some other active elements with installing a few other services. ( read more)

Lets check out several cases

General example

One of the most fundamental list group is an unordered list with list pieces and the proper classes. Build on it having the selections that come next, alternatively through your specific CSS as needed.

Basic  model

<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 show the existing active variety.

Active  elements
<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 objects

Add in

.disabled
to a
.list-group-item
to make it seem like disabled. Note that a number of components with are going to as well demand custom JavaScript to entirely turn off their click activities (e.g., urls).

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

Use

<a>
or else
<button>
in order to develop workable list group items along with hover, disabled, and active forms through including
.list-group-item-action
We isolated these pseudo-classes to make certain list groups made of non-interactive components (like
<li>
as well as
<div>
don't provide a click or even touch affordance.

Don't forget to not utilize the traditional

.btn
classes here.

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

With

<button>
you can surely additionally utilize the
disabled
feature as opposed to
.disabled
the class. Sadly,
<a>
don't support the disabled attribute.

Linking 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 items by having a stateful background plus coloration.

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 perform with

.list-group-item-action
Note the addition of the hover designs here not present in the last example. Additionally supported is the
.active
employ it to indicate an active selection on a contextual list group item.

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>

Conveying meaning toward assistive innovations.

Employing color to incorporate meaning simply brings a graphical sign, which will not be shared to users of assistive technologies -- for example, display screen readers. Be sure that relevant information represented with the color option is either evident from the web content in itself (e.g. the noticeable content), or else is featured via different solutions, such as added text concealed using the

.sr-only
class.

Using badges

Incorporate badges to any type of list group piece to present unread totals, activity, and more with help from a number of utilities. Take note of the justify-content-between utility class and the badge's positioning.

 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 web content

Include pretty much any type of HTML within, and even for linked list groups just like the one below, using flexbox utilities.

Custom 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

In conclusion, list group is a robust and helpful component within Bootstrap 4 which helps you to set up an unordered list much more organized, interactive, and responsive with no spoiling on the visual appeal or layout of the list objects themselves.

Check several video information relating to Bootstrap list:

Linked topics:

Bootstrap list authoritative documentation

Bootstrap list  formal documentation

Bootstrap list short training

Bootstrap list tutorial

Bootstrap list issue

Bootstrap list  difficulty