List Groups

LeptonX uses Bootstrap List Group's component's latest version.
List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within.

Basic example

The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed.

Preview
  • An item
  • A second item
  • A third item
  • A fourth item
  • And a fifth one
HTML
<ul class="list-group">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
  <li class="list-group-item">A fourth item</li>
  <li class="list-group-item">And a fifth one</li>
</ul>
 

Active & disabled items

Add .active to a .list-group-item to indicate the current active selection.

Add .disabled to a .list-group-item to make it appear disabled. Note that some elements with .disabled will also require custom JavaScript to fully disable their click events (e.g., links).

Preview
  • An active item
  • A second item
  • An disabled item
  • A fourth item
  • And a fifth one
HTML
<ul class="list-group">
  <li class="list-group-item active" aria-current="true">An active item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item disabled" aria-disabled="true">
    An disabled item
  </li>
  <li class="list-group-item">A fourth item</li>
  <li class="list-group-item">And a fifth one</li>
</ul>
 

Links

Use <a>s or <button>s to create actionable list group items with hover, disabled, and active states by adding .list-group-item-action. We separate these pseudo-classes to ensure list groups made of non-interactive elements (like <li>s or <div>s) don’t provide a click or tap affordance.

HTML
<div class="list-group">
  <a
    href="#"
    class="list-group-item list-group-item-action active"
    aria-current="true"
  >
    The current link item
  </a>
  <a href="#" class="list-group-item list-group-item-action"
    >A second link item</a
  >
  <a href="#" class="list-group-item list-group-item-action"
    >A third link item</a
  >
  <a href="#" class="list-group-item list-group-item-action"
    >A fourth link item</a
  >
  <a
    href="#"
    class="list-group-item list-group-item-action disabled"
    tabindex="-1"
    aria-disabled="true"
    >A disabled link item</a
  >
</div>
 

Buttons

With <button>s, you can also make use of the disabled attribute instead of the .disabled class. Sadly, <a>s don’t support the disabled attribute.

Preview
HTML
<div class="list-group">
  <button
    type="button"
    class="list-group-item list-group-item-action active"
    aria-current="true"
  >
    The current button
  </button>
  <button type="button" class="list-group-item list-group-item-action">
    A second item
  </button>
  <button type="button" class="list-group-item list-group-item-action">
    A third button item
  </button>
  <button type="button" class="list-group-item list-group-item-action">
    A fourth button item
  </button>
  <button type="button" class="list-group-item list-group-item-action" disabled>
    A disabled button item
  </button>
</div>
 

With badges

Preview
  • Cras justo odio 14
  • Dapibus ac facilisis in 2
  • Morbi leo risus 1
HTML
<ul class="list-group">
  <li class="list-group-item">
    Cras justo odio <span class="badge badge-pill bg-primary">14</span>
  </li>
  <li class="list-group-item">
    Dapibus ac facilisis in <span class="badge badge-pill bg-secondary">2</span>
  </li>
  <li class="list-group-item">
    Morbi leo risus <span class="badge badge-pill bg-info">1</span>
  </li>
</ul>
 

Numbered

Add the .list-group-numbered modifier class (and optionally use an <ol> element) to opt into numbered list group items. Numbers are generated via CSS (as opposed to a <ol>s default browser styling) for better placement inside list group items and to allow for better customization.

Numbers are generated by counter-reset on the <ol>, and then styled and placed with a ::before pseudo-element on the <li> with counter-increment and content.

Preview
  1. Cras justo odio
  2. Cras justo odio
  3. Cras justo odio
HTML
<ol class="list-group list-group-numbered">
  <li class="list-group-item">Cras justo odio</li>
  <li class="list-group-item">Cras justo odio</li>
  <li class="list-group-item">Cras justo odio</li>
</ol>
 

Flush

Add .list-group-flush to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).

Preview
  • An item
  • A second item
  • A third item
  • A fourth item
  • And a fifth one
HTML
<ul class="list-group list-group-flush">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
  <li class="list-group-item">A fourth item</li>
  <li class="list-group-item">And a fifth one</li>
</ul>
 

Checkboxes and radios

Place Bootstrap’s checkboxes and radios within list group items and customize as needed. You can use them without <label>s, but please remember to include an aria-label attribute and value for accessibility.

Preview
  • First checkbox
  • Second checkbox
  • Third checkbox
  • Fourth checkbox
  • Fifth checkbox
HTML
<div class="d-flex">
  <ul class="list-group flex-grow-1 me-2">
    <li class="list-group-item">
      <input
        class="form-check-input me-1"
        type="checkbox"
        value=""
        aria-label="..."
      />
      First checkbox
    </li>
    <li class="list-group-item">
      <input
        class="form-check-input me-1"
        type="checkbox"
        value=""
        aria-label="..."
      />
      Second checkbox
    </li>
    <li class="list-group-item">
      <input
        class="form-check-input me-1"
        type="checkbox"
        value=""
        aria-label="..."
      />
      Third checkbox
    </li>
    <li class="list-group-item">
      <input
        class="form-check-input me-1"
        type="checkbox"
        value=""
        aria-label="..."
      />
      Fourth checkbox
    </li>
    <li class="list-group-item">
      <input
        class="form-check-input me-1"
        type="checkbox"
        value=""
        aria-label="..."
      />
      Fifth checkbox
    </li>
  </ul>

  <div class="list-group flex-grow-1">
    <label class="list-group-item">
      <input
        class="form-check-input me-1"
        type="radio"
        name="RadioDefault"
        value=""
      />
      First radio
    </label>
    <label class="list-group-item">
      <input
        class="form-check-input me-1"
        type="radio"
        name="RadioDefault"
        value=""
      />
      Second radio
    </label>
    <label class="list-group-item">
      <input
        class="form-check-input me-1"
        type="radio"
        name="RadioDefault"
        value=""
      />
      Third radio
    </label>
    <label class="list-group-item">
      <input
        class="form-check-input me-1"
        type="radio"
        name="RadioDefault"
        value=""
      />
      Fourth radio
    </label>
    <label class="list-group-item">
      <input
        class="form-check-input me-1"
        type="radio"
        name="RadioDefault"
        value=""
      />
      Fifth radio
    </label>
  </div>
</div>
 

Custom content

Add nearly any HTML within, even for linked list groups like the one below, with the help of flexbox utilities.

HTML
<div class="list-group">
  <a
    href="#"
    class="list-group-item list-group-item-action active"
    aria-current="true"
  >
    <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">Some placeholder content in a paragraph.</p>
    <small>And some small print.</small>
  </a>
  <a href="#" class="list-group-item list-group-item-action">
    <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">Some placeholder content in a paragraph.</p>
    <small class="text-muted">And some muted small print.</small>
  </a>
  <a href="#" class="list-group-item list-group-item-action">
    <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">Some placeholder content in a paragraph.</p>
    <small class="text-muted">And some muted small print.</small>
  </a>
</div>
 

Horizontal

Add .list-group-horizontal to change the layout of list group items from vertical to horizontal across all breakpoints. Alternatively, choose a responsive variant .list-group-horizontal-{sm|md|lg|xl|xxl} to make a list group horizontal starting at that breakpoint’s min-width. Currently horizontal list groups cannot be combined with flush list groups.

ProTip: Want equal-width list group items when horizontal? Add .flex-fill to each list group item.

Preview
  • An item
  • A second item
  • A third item
  • An item
  • A second item
  • A third item
  • An item
  • A second item
  • A third item
  • An item
  • A second item
  • A third item
  • An item
  • A second item
  • A third item
  • An item
  • A second item
  • A third item
HTML
<ul class="list-group list-group-horizontal">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-sm">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-md">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-lg">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-xl">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-xxl">
  <li class="list-group-item">An item</li>
  <li class="list-group-item">A second item</li>
  <li class="list-group-item">A third item</li>
</ul>
 

Contextual classes

Use contextual classes to style list items with a stateful background and color.

Preview
  • Cras justo odio
  • A simple Primary list group item
  • A simple Secondary list group item
  • A simple Success list group item
  • A simple Danger list group item
  • A simple Warning list group item
  • A simple Info list group item
  • A simple Light list group item
  • A simple Dark list group item
HTML
<ul class="list-group">
  <li class="list-group-item">Cras justo odio</li>
  <li class="list-group-item list-group-item-primary">
    A simple Primary list group item
  </li>
  <li class="list-group-item list-group-item-secondary">
    A simple Secondary list group item
  </li>
  <li class="list-group-item list-group-item-success">
    A simple Success list group item
  </li>
  <li class="list-group-item list-group-item-danger">
    A simple Danger list group item
  </li>
  <li class="list-group-item list-group-item-warning">
    A simple Warning list group item
  </li>
  <li class="list-group-item list-group-item-info">
    A simple Info list group item
  </li>
  <li class="list-group-item list-group-item-light">
    A simple Light list group item
  </li>
  <li class="list-group-item list-group-item-dark">
    A simple Dark list group item
  </li>
</ul>
 

Contextual classes with link

HTML
<ul class="list-group">
  <a class="list-group-item list-group-item-action" href="#">Cras justo odio</a>
  <a
    class="list-group-item list-group-item-primary list-group-item-action"
    href="#"
    >A simple Primary list group item</a
  >
  <a
    class="list-group-item list-group-item-secondary list-group-item-action"
    href="#"
    >A simple Secondary list group item</a
  >
  <a
    class="list-group-item list-group-item-success list-group-item-action"
    href="#"
    >A simple Success list group item</a
  >
  <a
    class="list-group-item list-group-item-danger list-group-item-action"
    href="#"
    >A simple Danger list group item</a
  >
  <a
    class="list-group-item list-group-item-warning list-group-item-action"
    href="#"
    >A simple Warning list group item</a
  >
  <a
    class="list-group-item list-group-item-info list-group-item-action"
    href="#"
    >A simple Info list group item</a
  >
  <a
    class="list-group-item list-group-item-light list-group-item-action"
    href="#"
    >A simple Light list group item</a
  >
  <a
    class="list-group-item list-group-item-dark list-group-item-action"
    href="#"
    >A simple Dark list group item</a
  >
</ul>