A decade of Canvas at your command — powered by our custom AI engineStart Building →
Bootstrap 5Content

Bootstrap 5 List Group

The Bootstrap 5 List Group is a flexible component for displaying a series of related content — from simple text lists to complex interactive panels. It supports contextual colours, badges, active and disabled states, flush and horizontal layouts, numbered lists, and linked or button-based actionable items.

Primary Class

.list-group

Common Use Cases

  • Displaying a sidebar navigation menu with active-state highlighting for the current page
  • Showing a notification or activity feed with badges indicating unread counts
  • Rendering a settings panel where each list item links to a configuration sub-page
  • Presenting search results or filtered items in a clean, scannable vertical list
  • Building a numbered step-by-step checklist for onboarding flows or task completion

Variants & Classes

VariantDescription
Flush List GroupRemoves outer borders and rounded corners for edge-to-edge rendering inside parent containers like cards.
Horizontal List GroupDisplays items in a horizontal row instead of vertically. Supports responsive breakpoints.
Numbered List GroupAutomatically prepends sequential numbers to each item using CSS counters.
Actionable List GroupUses <a> or <button> elements as list items, enabling hover and active states for clickable lists.

Code Example

<ul class="list-group">
  <li class="list-group-item d-flex justify-content-between align-items-center active" aria-current="true">
    Dashboard
    <span class="badge bg-light text-dark rounded-pill">14</span>
  </li>
  <li class="list-group-item d-flex justify-content-between align-items-center">
    Messages
    <span class="badge bg-primary rounded-pill">3</span>
  </li>
  <li class="list-group-item d-flex justify-content-between align-items-center">
    Orders
    <span class="badge bg-primary rounded-pill">27</span>
  </li>
  <li class="list-group-item d-flex justify-content-between align-items-center">
    Settings
    <span class="badge bg-primary rounded-pill">0</span>
  </li>
  <li class="list-group-item d-flex justify-content-between align-items-center disabled" aria-disabled="true">
    Archived
    <span class="badge bg-secondary rounded-pill">5</span>
  </li>
</ul>

Live Examples

Flush List Group with Contextual Colours

A flush list group inside a card showing items with different contextual background colours for status indication.

Example 1
Order Status
  • Shipped 12
  • Processing 4
  • Cancelled 1
  • Pending 8

Numbered Actionable List Group

A numbered list group with clickable items and secondary text, suitable for ranked content or step-based flows.

Example 2
  1. Set up your account
    Enter your email and create a secure password to get started.
    Step 1
  2. Choose a template
    Browse our gallery and pick a design that fits your brand.
    Step 2
  3. Customise & publish
    Edit colours, text, and images, then publish your site in one click.
    Step 3

Canvas Framework Variants

The Canvas template extends Bootstrap 5 with 1,658+ component variants. Generate any of these using Canvas Builder:

  • Canvas sidebar navigation list group with brand-coloured active state
  • Canvas notification feed list group with unread badges and timestamps
  • Canvas flush list group inside a card for dashboard stat panels
  • Canvas numbered checklist list group for onboarding wizards

Best Practices

Combine with badges for data-rich lists

Place a .badge inside each .list-group-item using d-flex justify-content-between align-items-center on the item. This creates a clean layout where the label sits on the left and the count or status badge aligns to the right — ideal for notification counts, order totals, or task statuses.

Use flush variant inside cards

When placing a list group inside a .card, always use the .list-group-flush class. This removes the outer border and border-radius from the list group so it sits flush against the card edges, avoiding double borders and visual inconsistencies.

Add aria-current and aria-disabled for accessibility

Mark the currently active list item with aria-current='true' so screen readers announce it as the active selection. For disabled items, add the disabled class and aria-disabled='true' to ensure assistive technologies communicate the non-interactive state. Avoid using tabindex='-1' alone — pair it with aria-disabled for full coverage.

FAQ

What is the difference between a list group and a regular HTML list?
A regular HTML <ul> or <ol> is a semantic list element with default browser styling (bullet points or numbers, indentation). A Bootstrap 5 list group wraps list items in .list-group and .list-group-item classes that provide card-like styling, contextual colour variants, active/disabled states, badge support, and built-in responsive layouts (horizontal, flush, numbered). It is designed for interactive UI panels rather than plain document lists.
Can I use links or buttons as list group items?
Yes. Use <a> elements with the .list-group-item and .list-group-item-action classes for linked lists, or <button> elements with the same classes for JavaScript-driven actions. The -action class adds hover and focus states automatically. Wrap the items in a <div class='list-group'> instead of <ul> when using non-list-item elements to maintain valid HTML semantics.
How do I make a horizontal list group responsive?
Add a responsive breakpoint suffix to the horizontal class — for example, .list-group-horizontal-md renders items horizontally on medium screens and above, but stacks them vertically on smaller screens. Available suffixes are -sm, -md, -lg, -xl, and -xxl, matching Bootstrap's standard breakpoint tiers.
How does Canvas Builder generate list group components?
Canvas Builder outputs semantic, accessible list group markup based on your specified use case. It automatically selects the correct variant (flush for cards, numbered for steps, actionable for navigation), applies your brand's colour tokens to the active state and badges, and includes aria attributes for accessibility. The generated HTML is self-contained Bootstrap 5 code ready to paste into any project.