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.
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.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Active items
Add .active
to a .list-group-item
to indicate the current active selection.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
<ul class="list-group">
<li class="list-group-item active">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Disabled items
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).
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
<ul class="list-group">
<li class="list-group-item disabled">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
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).
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Contextual classes
Use contextual classes to style list items with a stateful background and color.
- Dapibus ac facilisis in
- 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">Dapibus ac facilisis in</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.
<div class="list-group">
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" href="#">
Home
<span class="badge badge-primary badge-light">14</span>
</a>
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" href="#">
Profile
<span class="badge badge-danger">New</span>
</a>
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" href="#">
<span>Messages <span class="d-block small text-muted">Secondary text</span></span>
<span class="badge badge-info badge-pill">1</span>
</a>
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" href="#">
Settings
<span class="badge badge-secondary badge-pill">Pro</span>
</a>
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center disabled" href="#">
<span>Notifications - <span class="small">disabled</span></span>
<span class="badge badge-primary">7</span>
</a>
</div>
Custom content
Add nearly any HTML within, even for linked list groups like the one below, with the help of flexbox utilities.
-
Jane Moris Pro saved your pin
5 minutes ago -
Alberta Watson is offering free coffee
12 minutes ago -
Htmlstream sent you a message
56 minutes ago -
Edmon Low Free saved your pin
2 hours ago
<ul class="list-group">
<li class="list-group-item">
<div class="media">
<div class="d-flex mr-3">
<img class="rounded-circle shadow mt-1" width="40" height="40" src="../assets/img-temp/100x100/img4.jpg" alt="Htmlstream">
</div>
<div class="media-body">
<p class="mb-0"><span class="text-black">Jane Moris</span> <span class="badge badge-primary mr-1">Pro</span> saved your pin</p>
<span class="small text-muted">5 minutes ago</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="media">
<div class="d-flex mr-3">
<img class="rounded-circle shadow mt-1" width="40" height="40" src="../assets/img-temp/ava/user-unknown.jpg" alt="Htmlstream">
</div>
<div class="media-body">
<p class="mb-0"><span class="text-black">Alberta Watson</span> is offering free coffee</p>
<span class="small text-muted">12 minutes ago</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="media">
<div class="d-flex mr-3">
<img class="rounded-circle shadow mt-1" width="40" height="40" src="../assets/img-temp/ava/hs.jpg" alt="Htmlstream">
</div>
<div class="media-body">
<p class="mb-0"><span class="text-black">Htmlstream</span> sent you a message</p>
<span class="small text-muted">56 minutes ago</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="media">
<div class="d-flex mr-3">
<img class="rounded-circle shadow mt-1" width="40" height="40" src="../assets/img-temp/100x100/img1.jpg" alt="Htmlstream">
</div>
<div class="media-body">
<p class="mb-0"><span class="text-black">Edmon Low</span> <span class="badge badge-secondary mr-1">Free</span> saved your pin</p>
<span class="small text-muted">2 hours ago</span>
</div>
</div>
</li>
</ul>
JavaScript behavior
For more information, see the official Bootstrap documentation.