Vue Bootstrap list Group

List groups are a flexible and powerful component for displaying a series of content. List group items can be modified and extended to support just about any content within. They can also be used as navigation with the right modifier class.


Basic example

The most basic list group is simply an unordered list with list items and the proper classes. Build upon it with the options that follow, or your own CSS as needed.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus
  • Porta ac consectetur ac
  • Vestibulum at eros
                
<list-group>
  <list-group-item>Cras justo odio</list-group-item>
  <list-group-item>Dapibus ac facilisis in</list-group-item>
  <list-group-item>Morbi leo risus</list-group-item>
  <list-group-item>Porta ac consectetur ac</list-group-item>
  <list-group-item>Vestibulum at eros</list-group-item>
</list-group>
                
            

Labels

Add labels to any list group item to show unread counts, activity, etc.

  • Cras justo odio 14
  • Dapibus ac facilisis in 2
  • Morbi leo risus 1
                
<list-group>
  <list-group-item>Cras justo odio<badge color="primary" pill>14</badge></list-group-item>
  <list-group-item>Dapibus ac facilisis in<badge color="primary" pill>2</badge></list-group-item>
  <list-group-item>Morbi leo risus<badge color="primary" pill>1</badge></list-group-item>
</list-group>
                
            

Linked items

Linkify list group items by using anchor tags instead of list items (that also means a parent <div> instead of an <ul>). No need for individual parents around each element.

                
<list-group>
  <list-group-item :active="true">Cras justo odio</list-group-item>
  <list-group-item>Dapibus ac facilisis in</list-group-item>
  <list-group-item>Morbi leo risus</list-group-item>
  <list-group-item>Porta ac consectetur ac</list-group-item>
  <list-group-item>Vestibulum at eros</list-group-item>
</list-group>
                
            

Links and buttons

Use <a>s or <button>s to create actionable list group items with hover, disabled, and active states by adding :action="true". 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.

                
<list-group>
  <list-group-item :action="true" :active="true">Cras justo odio</list-group-item>
  <list-group-item :action="true">Dapibus ac facilisis in</list-group-item>
  <list-group-item :action="true">Morbi leo risus</list-group-item>
  <list-group-item :action="true">Porta ac consectetur ac</list-group-item>
  <list-group-item :action="true">Vestibulum at eros</list-group-item>
</list-group>
                
            

Disabled item

Add disabled to a <list-group-item> to gray it out to appear disabled.

                
<list-group>
  <list-group-item disabled>Cras justo odio</list-group-item>
  <list-group-item>Dapibus ac facilisis in</list-group-item>
  <list-group-item>Morbi leo risus</list-group-item>
  <list-group-item>Porta ac consectetur ac</list-group-item>
  <list-group-item>Vestibulum at eros</list-group-item>
</list-group>
                
            

Contextual classes

Use contextual classes to style list items, default or linked. Also includes .active state.

  • Dapibus ac facilisis in
  • Cras sit amet nibh libero
  • Porta ac consectetur ac
  • Vestibulum at eros

                
<list-group>
  <list-group-item class="list-group-item-success">Dapibus ac facilisis in</list-group-item>
  <list-group-item class="list-group-item-info">Cras sit amet nibh libero</list-group-item>
  <list-group-item class="list-group-item-warning">Porta ac consectetur ac</list-group-item>
  <list-group-item class="list-group-item-danger">Vestibulum at eros</list-group-item>
</list-group>

<list-group>
  <list-group-item :action="true" class="list-group-item-success">Dapibus ac facilisis in</list-group-item>
  <list-group-item :action="true" class="list-group-item-info">Cras sit amet nibh libero</list-group-item>
  <list-group-item :action="true" class="list-group-item-warning">Porta ac consectetur ac</list-group-item>
  <list-group-item :action="true" class="list-group-item-danger">Vestibulum at eros</list-group-item>
</list-group>
                
            

Custom content

Add nearly any HTML within, even for linked list groups like the one below.

                
<list-group>
  <list-group-item href="#" :action="true" :active="true" class="flex-column align-items-start">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small>3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small>Donec id elit non mi porta.</small>
  </list-group-item>
  <list-group-item href="#" :action="true" class="flex-column align-items-start">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small class="text-muted">3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small class="text-muted">Donec id elit non mi porta.</small>
  </list-group-item>
  <list-group-item href="#" :action="true" class="flex-column align-items-start">
    <div class="d-flex w-100 justify-content-between">
      <h5 class="mb-1">List group item heading</h5>
      <small class="text-muted">3 days ago</small>
    </div>
    <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    <small class="text-muted">Donec id elit non mi porta.</small>
  </list-group-item>
</list-group>