List group

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.

Bootstrap List Group documentation share-external-link-1

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. Add .active to a .list-group-item to indicate the current active selection.

  • An active item
  • A second item
  • A third item
  • A fourth item
  • And a fifth one
<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">A third item</li>
    <li class="list-group-item">A fourth item</li>
    <li class="list-group-item">And a fifth one</li>
</ul>

Links and buttons

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.

Be sure to not use the standard .btn classes here.

<div class="list-group">
    <a href="javascript: void(0);" class="list-group-item list-group-item-action active" aria-current="true">
        The current link item
    </a>
    <a href="javascript: void(0);" class="list-group-item list-group-item-action">A second link item</a>
    <a href="javascript: void(0);" class="list-group-item list-group-item-action">A third link item</a>
    <a href="javascript: void(0);" class="list-group-item list-group-item-action">A fourth link item</a>
    <a class="list-group-item list-group-item-action disabled">A disabled link item</a>
</div>

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).

  • An item
  • A second item
  • A third item
  • A fourth item
  • And a fifth one
<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>

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.

  1. A list item
  2. A list item
  3. A list item
<ol class="list-group list-group-numbered">
    <li class="list-group-item">A list item</li>
    <li class="list-group-item">A list item</li>
    <li class="list-group-item">A list item</li>
</ol>

Contextual classes

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

  • A simple default list group item
  • 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
<ul class="list-group">
    <li class="list-group-item">A simple default list group item</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>

With badges

Add badges to any list group item to show unread counts, activity, and more with the help of some utilities.

  • A list item 14
  • A second list item 2
  • A third list item 1
<ul class="list-group">
    <li class="list-group-item active d-flex justify-content-between align-items-center" aria-current="true">
        A list item
        <span class="badge bg-primary rounded-pill">14</span>
    </li>
    <li class="list-group-item d-flex justify-content-between align-items-center">
        A second list item
        <span class="badge bg-primary rounded-pill">2</span>
    </li>
    <li class="list-group-item d-flex justify-content-between align-items-center">
        A third list item
        <span class="badge bg-primary rounded-pill">1</span>
    </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.


<ul class="list-group">
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="firstCheckbox">
        <label class="form-check-label" for="firstCheckbox">First checkbox</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="secondCheckbox">
        <label class="form-check-label" for="secondCheckbox">Second checkbox</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckbox">
        <label class="form-check-label" for="thirdCheckbox">Third checkbox</label>
    </li>
</ul>

<ul class="list-group">
    <li class="list-group-item">
        <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="firstRadio" checked>
        <label class="form-check-label" for="firstRadio">First radio</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="secondRadio">
        <label class="form-check-label" for="secondRadio">Second radio</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="thirdRadio">
        <label class="form-check-label" for="thirdRadio">Third radio</label>
    </li>
</ul>

You can use .stretched-link on <label>s to make the whole list group item clickable.

<ul class="list-group">
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="firstCheckboxStretched">
        <label class="form-check-label stretched-link" for="firstCheckboxStretched">First checkbox</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="secondCheckboxStretched">
        <label class="form-check-label stretched-link" for="secondCheckboxStretched">Second checkbox</label>
    </li>
    <li class="list-group-item">
        <input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckboxStretched">
        <label class="form-check-label stretched-link" for="thirdCheckboxStretched">Third checkbox</label>
    </li>
</ul>