List

Effectively group list items together with our list utility class.

Usage

A list is a way of portraying similar data in an orderly fashion. List items should be wrapped in a <ul> element with a list class attached to it.
Each <li> or <a> tag within the list should have a list-item class attached to it, see below:

  • List item
  • List item
  • List item
  • List item
  • List item
<ul class="list">
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
</ul>Copy iconSuccess icon

Active

In order to display a colored background on one of the list items, simply add the active class

  • List item
  • List item
  • List item
  • List item
  • List item
<ul class="list">
    <li class="list-item active">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
</ul>Copy iconSuccess icon

Disabled

To make a list item disabled, add the disabled class, which will slightly mute the color of the text.

  • List item
  • List item
  • List item
  • List item
  • List item
<ul class="list">
    <li class="list-item disabled">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
    <li class="list-item">List item</li>
</ul>Copy iconSuccess icon

Icon

Icons can also be used in conjunction with a list-item element. Simply add the list-icon class, which will add the display: flex; property.

<ul class="list">
    <a href="#!" class="list-item list-icon">
        List item
        <i class="fas fa-caret-right fa-lg"></i>
    </a>                        
    <a href="#!" class="list-item list-icon active">
        List item
        <i class="fas fa-caret-right fa-lg"></i>
    </a>
    <a href="#!" class="list-item list-icon">
        List item
        <i class="fas fa-caret-right fa-lg"></i>
    </a>                        
    <a href="#!" class="list-item list-icon">
        List item
        <i class="fas fa-caret-right fa-lg"></i>
    </a>
    <a href="#!" class="list-item list-icon">
        List item
        <i class="fas fa-caret-right fa-lg"></i>
    </a>                        
</ul>Copy iconSuccess icon

Badge

Use the mesh badges to create notifications within the list. Use the list-icon class and add the badge.
Note: you may need to add our color utility classes to achieve the right appearance, see below:

<ul class="list">
    <a href="#!" class="list-item list-icon">
        List item
        <div class="badge badge-primary badge-rounded">2</div>
    </a>                        
    <a href="#!" class="list-item list-icon active">
        List item
        <div class="badge badge-primary badge-rounded bg-white c-primary">4</div>
    </a>
    <a href="#!" class="list-item list-icon">
        List item
        <div class="badge badge-primary badge-rounded">14</div>
    </a>                        
</ul>Copy iconSuccess icon

Full monty

The possibilities are endless, here is taster of what you can achieve with our list component.

<ul class="list w-100 w-tab-60">
    <a href="#!" class="list-item w-100 c-dark">
        <div class="d-flex justify-content-between align-items-center my-2">
            <h3 class="mb-0">List item heading</h3>
            <div class="badge badge-primary">Posted 2 days ago</div>
        </div>
        <p>Kogi single-origin coffee farm-to-table...</p>
        <h6>Posted by Tiger Woods</h6>
    </a>                        
    <a href="#!" class="list-item active">
        <div class="d-flex justify-content-between align-items-center my-2">
            <h3 class="mb-0">List item heading</h3>
            <div class="badge badge-white">Posted 5 days ago</div>
        </div>
        <p>Kogi single-origin coffee farm-to-table...</p>
        <h6>Posted by Gordon Ramsey</h6>
    </a> 
    <a href="#!" class="list-item w-100 c-dark">
        <div class="d-flex justify-content-between align-items-center my-2">
            <h3 class="mb-0">List item heading</h3>
            <div class="badge badge-primary">Posted 10 days ago</div>
        </div>
        <p>Kogi single-origin coffee farm-to-table...</p>
        <h6>Posted by Above & Beyond</h6>
    </a>                       
</ul>
Copy iconSuccess icon

Variables

Change border colors, active colors and disabled with the variables below.

Variable Value Description
$list-background-color: #fff;
Color The default background color of the list component.
$list-border-color: #ddd;
Color The border color of the list component.
$list-active-color: color('primary');
Color The active (user selected) color of the list component, the default takes the primary color from the color palette.
$list-disabled-color: #999;
Color The disabled color of a list item.