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.
Default
- An item
- A second item
- A third item
- A fourth item
- And a fifth one
Active
- An active item
- A second item
- A third item
- A fourth item
- And a fifth one
Disabled
- A disabled item
- A second item
- A third item
- A fourth item
- And a fifth one
Add .active
to a .list-group-item
to indicate the current active selection.
and Add .disabled
to a .list-group-item
to make it appear disable.
Code Example
<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> <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> <ul class="list-group"> <li class="list-group-item disabled" aria-disabled="true">A disabled 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.
with link
with button
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.
Code Example
<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 class="list-group-item list-group-item-action disabled">A disabled link item</a> </div> <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>
Flush and Numbered
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).
Add the .list-group-numbered
modifier class (and optionally use an <ol>
element) to opt into numbered list group items.
Numbered
- A list item
- A list item
- A list item
- A list item
- A list item
custom content
- 14SubheadingContent for list item
- 14SubheadingContent for list item
- 14SubheadingContent for list item
flash
- An item
- A second item
- A third item
- A fourth item
Code Example
<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> <li class="list-group-item">A list item</li> <li class="list-group-item">A list item</li> </ol> <ol class="list-group list-group-numbered"> <li class="list-group-item d-flex justify-content-between align-items-start"> <div class="ms-2 me-auto"> <div class="fw-bold">Subheading</div> Content for list item </div> <span class="badge bg-primary rounded-pill">14</span> </li> <li class="list-group-item d-flex justify-content-between align-items-start"> <div class="ms-2 me-auto"> <div class="fw-bold">Subheading</div> Content for list item </div> <span class="badge bg-primary rounded-pill">14</span> </li> <li class="list-group-item d-flex justify-content-between align-items-start"> <div class="ms-2 me-auto"> <div class="fw-bold">Subheading</div> Content for list item </div> <span class="badge bg-primary rounded-pill">14</span> </li> </ol> <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>
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
.
- 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
Code Example
<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.
- 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
Contextual classes also work with .list-group-item-action
. Note the addition of the hover styles here not present in the previous example. Also supported is the .active
state; apply it to indicate an active selection on a contextual list group item.
Code Example
<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> <div class="list-group"> <a href="#" class="list-group-item list-group-item-action">A simple default list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-primary">A simple primary list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-secondary">A simple secondary list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-success">A simple success list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-danger">A simple danger list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-warning">A simple warning list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-info">A simple info list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-light">A simple light list group item</a> <a href="#" class="list-group-item list-group-item-action list-group-item-dark">A simple dark list group item</a> </div>
Checkboxes and radios
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.
without label
- First checkbox
- Second checkbox
- Third checkbox
- Fourth checkbox
- Fifth checkbox
with label
Code Example
<ul class="list-group"> <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"> <label class="list-group-item"> <input class="form-check-input me-1" type="checkbox" value=""> First checkbox </label> <label class="list-group-item"> <input class="form-check-input me-1" type="checkbox" value=""> Second checkbox </label> <label class="list-group-item"> <input class="form-check-input me-1" type="checkbox" value=""> Third checkbox </label> <label class="list-group-item"> <input class="form-check-input me-1" type="checkbox" value=""> Fourth checkbox </label> <label class="list-group-item"> <input class="form-check-input me-1" type="checkbox" value=""> Fifth checkbox </label> </div>