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.
<ul class="list-group" style="max-width: 300px;">
<li class="list-group-item active">
<i class="bi-house list-group-icon me-2"></i> Dashboard
</li>
<li class="list-group-item">
<i class="bi-person list-group-icon me-2"></i> Profile
</li>
<li class="list-group-item">
<i class="bi-list-task list-group-icon me-2"></i> Tasks
</li>
<li class="list-group-item">
<i class="bi-layers list-group-icon me-2"></i> Projects
</li>
<li class="list-group-item">
<i class="bi-people list-group-icon me-2"></i> Members
</li>
</ul>
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 class="list-group-item list-group-item-action active" href="#">
<i class="bi-house list-group-icon me-2"></i> Dashboard
</a>
<a class="list-group-item list-group-item-action" href="#">
<i class="bi-person list-group-icon me-2"></i> Profile
</a>
<a class="list-group-item list-group-item-action" href="#">
<i class="bi-list-task list-group-icon me-2"></i> Tasks
</a>
<a class="list-group-item list-group-item-action" href="#">
<i class="bi-layers list-group-icon me-2"></i> Projects
</a>
<a class="list-group-item list-group-item-action" href="#">
<i class="bi-people list-group-icon me-2"></i> Members
</a>
</div>
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).
<ul class="list-group list-group-flush">
<li class="list-group-item">
<i class="bi-house list-group-icon me-2"></i> Dashboard
</li>
<li class="list-group-item">
<i class="bi-person list-group-icon me-2"></i> Profile
</li>
<li class="list-group-item">
<i class="bi-list-task list-group-icon me-2"></i> Tasks
</li>
<li class="list-group-item">
<i class="bi-layers list-group-icon me-2"></i> Projects
</li>
<li class="list-group-item">
<i class="bi-people list-group-icon me-2"></i> Members
</li>
</ul>
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
psuedo-element on the <li>
with counter-increment
and content
.
<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>
These work great with custom content as well.
<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-semi-bold">Subheading</div>
Cras justo odio
</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-semi-bold">Subheading</div>
Cras justo odio
</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-semi-bold">Subheading</div>
Cras justo odio
</div>
<span class="badge bg-primary rounded-pill">14</span>
</li>
</ol>
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.
<ul class="list-group list-group-horizontal">
<li class="list-group-item d-sm-flex align-items-sm-center">
<i class="bi-house list-group-icon me-2"></i> Dashboard
</li>
<li class="list-group-item d-sm-flex align-items-sm-center">
<i class="bi-person list-group-icon me-2"></i> Profile
</li>
<li class="list-group-item d-sm-flex align-items-sm-center">
<i class="bi-list-task list-group-icon me-2"></i> Tasks
</li>
<li class="list-group-item">
<i class="bi-layers list-group-icon me-2"></i> Projects
</li>
<li class="list-group-item">
<i class="bi-people list-group-icon me-2"></i> Members
</li>
</ul>
Add badges to any list group item to show unread counts, activity, and more with the help of some utilities.
<ul class="list-group">
<li class="list-group-item d-flex align-items-center">
<i class="bi-house list-group-icon me-2"></i> Dashboard
<span class="badge bg-primary rounded-pill ms-auto">14</span>
</li>
<li class="list-group-item d-flex align-items-center">
<i class="bi-person list-group-icon me-2"></i> Profile
<span class="badge bg-primary rounded-pill ms-auto">2</span>
</li>
<li class="list-group-item d-flex align-items-center">
<i class="bi-list-task list-group-icon me-2"></i> Tasks
<span class="badge bg-primary rounded-pill ms-auto">1</span>
</li>
</ul>
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="" 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>
And if you want <label>
s as the .list-group-item
for large hit areas, you can do that, too.
<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>