List group
Preview
This is a preview of the Bootstrap element. For more details, please visit the official Bootstrap page.
Bootstrap pageBasic example
The most basic list group is an unordered list with list items and the proper classes.
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).
Use contextual classes to style list items with a stateful background and color. Contextual classes also work with .list-group-item-action.
- An item
- A second item
- A third item
- A fourth item
- And a fifth one
- An active item
- A disabled item
- A third item
- A fourth item
- And a fifth one
- A simple primary list group item
- A simple secondary list group item
- A simple success list group item
- A simple warning list group item
- A simple beets list group item
<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> </ul> <ul class="list-group"> <li class="list-group-item active">An active item</li> <li class="list-group-item disabled">A disabled item</li> <li class="list-group-item">A third item</li> </ul> <ul class="list-group"> <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-beets">A simple beets list group item</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.
<div class="list-group"> <a href="#" class="list-group-item list-group-item-action active">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 disabled">A disabled link item</a> </div> <div class="list-group"> <button class="list-group-item list-group-item-action active">The current button</button> <button class="list-group-item list-group-item-action">A second item</button> <button class="list-group-item list-group-item-action" disabled>A disabled button item</button> </div>
Flush and badges
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 badges to any list group item to show unread counts, activity, and more with the help of some flex-utilities.
- An item
- A second item
- A third item
- A fourth item
- And a fifth one
- A list item 14
- A second list item 2
- A third list item 1
<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> </ul> <ul class="list-group"> <li class="list-group-item d-flex justify-content-between align-items-center"> A list item <span class="badge bg-primary rounded-pill">14</span> </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.
ProTip: Want equal-width list group items when horizontal? Add .flex-fill to each list group item.
- An item
- A second item
- A third item
- An item
- A second item
- A third item
<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-xl"> <li class="list-group-item flex-fill">An item</li> <li class="list-group-item flex-fill">A second item</li> <li class="list-group-item flex-fill">A third item</li> </ul>