Lightbox-Gallery.com

Bootstrap List Example

Intro

List group is a great and convenient component which is spotted in Bootstrap 4. The element is used for displaying a chain or 'list' web content. The list group pieces have the ability to be changed and extended to support almost any type of material just within by using a number of options accessible for modification within the list itself. These particular list groups can certainly as well be applied for navigation along with using the appropriate modifier class.

In Bootstrap 4, the Bootstrap List Style is a element that designs the unordered lists in a specific way considering that it paves the way for producing custom web content inside complex lists free from needing to think about the presentation complication ( due to the fact that the language takes care of that on its own). ( learn more)

Solutions of Bootstrap List Style:

Given below are the features that are attainable inside of the list group element in Bootstrap 4:

• Unordered list: The most common style of list group which you can set up in Bootstrap 4 is an unordered list that has a variety of items using the appropriate classes. You can easily built upon it using the other opportunities that are attainable in the element.

• Active stuffs: You have the ability to pointed out the current active choice via simply bring in the

.active
direction to a
.list-group-item
This is practical for whenever you desire to create a list of materials that is able for clicking.

• Disabled items: You are able to even de-highlight a list item making it show up as though it has been disabled. You just simply need to incorporate the

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

• Hyperlinks and Buttons: With the buttons tag, you have the ability to quickly make an workable object inside the Bootstrap List Group which in turn means that you will have the ability to bring in hover, active, and disabled states to these types of elements through making use of the

.list-group-item-action
opportunity. { You can disconnect these pseudo-classes from the remaining classes in order to be sure that the non-interactive components in your code such as
<div>
or
<li>
are not clickable or workable too. It is suggested that you do not use the common button classes i.e
.btn
here.

• Contextual classes: This is one more awesome element that becomes part of the list group component which makes it possible for you to style every list element together with a definitive color and background. These are particularly practical for spotlight specific items or categorizing them according to color-'s code.

• Badges: You are able to additionally include badges to a list item to present the unread counts, activity on the object, and help additional active components via using additional services. ( helpful hints)

Lets check out a couple of cases

Standard type

The most standard list group is an unordered list with list items and the suitable classes. Build upon it with the features that follow, alternatively using your specific CSS as desired.

 Standard  type

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

Include in a

.active
to a
.list-group-item
to indicate the present active option.

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 elements

Put in

.disabled
to a
.list-group-item
to get it appear disabled. Keep in mind that various features with are going to likewise require customized JavaScript to totally disable their click 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 buttons

Apply

<a>
or else
<button>
in order to develop actionable list group things having hover, disabled, and active forms through including
.list-group-item-action
We split up these kinds of pseudo-classes to ensure list groups made of non-interactive elements (like
<li>
or even
<div>
don't produce a click on or touching affordance.

Ensure to not employ the standard

.btn
classes in this case.

 Urls 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 having

<button>
you have the ability to additionally utilize the
disabled
attribute as opposed to
.disabled
the class. Sadly,
<a>
do not support the disabled feature.

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 form list objects by using a stateful background and 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 also operate with

.list-group-item-action
Consider the inclusion of the hover formats here not present in the earlier example. Additionally supported is the
.active
utilize it to identify an active selection on a contextual list group unit.

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 directed toward assistive technological innovations.

Putting into action coloration to provide signifying just provides a visual signifier, which will definitely not be shared to operators of assistive technological innovations -- such as screen readers. Be sure that data represented by the color option is either evident directly from the content in itself (e.g. the noticeable words), or else is included through different methods, just like added text covered by having the

.sr-only
class.

Utilizing badges

Put in badges to any list group piece to display unread counts, activity, and much more through certain utilities. Keep in mind the justify-content-between utility class and the badge's position.

 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>

Customized content

Put in almost any kind of HTML in, and even for related list groups similar to the one listed below, with the aid of 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

In conclusion, list group is a robust and helpful component in Bootstrap 4 that allows you to produce an unordered list more organized, interactive, and responsive without any ruining on the visual appeal as well as layout of the list pieces themselves.

Inspect a couple of video guide relating to Bootstrap list:

Linked topics:

Bootstrap list authoritative documents

Bootstrap list  authoritative  documents

Bootstrap list training

Bootstrap list  information

Bootstrap list trouble

Bootstrap list  concern