Edit these docs Rate these docs

Vue Bootstrap List Group

Vue List Group - Bootstrap 4 & Material Design

Vue Bootstrap list group is a flexible component which displays not only simple list of elements but complex custom content.


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

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

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

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

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

        <script>
          import { mdbListGroup, mdbListGroupItem, mdbBadge } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem,
              mdbBadge
            }
          }
        </script>
      

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.


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

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

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.


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

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

Disabled item

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


        <template>
          <mdb-list-group>
            <mdb-list-group-item href="#" tag="a" disabled>Cras justo odio</mdb-list-group-item>
            <mdb-list-group-item href="#" tag="a">Dapibus ac facilisis in</mdb-list-group-item>
            <mdb-list-group-item href="#" tag="a">Morbi leo risus</mdb-list-group-item>
            <mdb-list-group-item href="#" tag="a">Porta ac consectetur ac</mdb-list-group-item>
            <mdb-list-group-item href="#" tag="a">Vestibulum at eros</mdb-list-group-item>
          </mdb-list-group>
        </template>
      

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

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


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

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

Custom content

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


        <template>
          <mdb-list-group>
            <mdb-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>
            </mdb-list-group-item>
            <mdb-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>
            </mdb-list-group-item>
            <mdb-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>
            </mdb-list-group-item>
          </mdb-list-group>
        </template>
      

        <script>
          import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
          export default {
            name: 'ListGroupPage',
            components: {
              mdbListGroup,
              mdbListGroupItem
            }
          }
        </script>
      

Horizontal

Add horizontal property to change the layout of list group items from vertical to horizontal across all breakpoints. Alternatively, add one of the following properties: sm md lg xl to make a list group horizontal starting at that breakpoint’s min-width.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus

          <template>
            <mdb-list-group horizontal>
              <mdb-list-group-item :action="true">Cras justo odio</mdb-list-group-item>
              <mdb-list-group-item :action="true">Dapibus ac facilisis in </mdb-list-group-item>
              <mdb-list-group-item :action="true">Morbi leo risus</mdb-list-group-item>
            </mdb-list-group>
          </template>
        

          <script>
            import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
            export default {
              name: 'HorizontalListPage',
              components: {
                mdbListGroup,
                mdbListGroupItem
              }
            }
          </script>
        
  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus

          <template>
            <mdb-list-group horizontal sm>
              <mdb-list-group-item :action="true">Cras justo odio</mdb-list-group-item>
              <mdb-list-group-item :action="true">Dapibus ac facilisis in </mdb-list-group-item>
              <mdb-list-group-item :action="true">Morbi leo risus</mdb-list-group-item>
            </mdb-list-group>
          </template>
        

          <script>
            import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
            export default {
              name: 'HorizontalListPage',
              components: {
                mdbListGroup,
                mdbListGroupItem
              }
            }
          </script>
        
  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus

          <template>
            <mdb-list-group horizontal md>
              <mdb-list-group-item :action="true">Cras justo odio</mdb-list-group-item>
              <mdb-list-group-item :action="true">Dapibus ac facilisis in </mdb-list-group-item>
              <mdb-list-group-item :action="true">Morbi leo risus</mdb-list-group-item>
            </mdb-list-group>
          </template>
        

          <script>
            import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
            export default {
              name: 'HorizontalListPage',
              components: {
                mdbListGroup,
                mdbListGroupItem
              }
            }
          </script>
        
  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus

          <template>
            <mdb-list-group horizontal lg>
              <mdb-list-group-item :action="true">Cras justo odio</mdb-list-group-item>
              <mdb-list-group-item :action="true">Dapibus ac facilisis in </mdb-list-group-item>
              <mdb-list-group-item :action="true">Morbi leo risus</mdb-list-group-item>
            </mdb-list-group>
          </template>
        

          <script>
            import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
            export default {
              name: 'HorizontalListPage',
              components: {
                mdbListGroup,
                mdbListGroupItem
              }
            }
          </script>
        
  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus

          <template>
            <mdb-list-group horizontal xl>
              <mdb-list-group-item :action="true">Cras justo odio</mdb-list-group-item>
              <mdb-list-group-item :action="true">Dapibus ac facilisis in </mdb-list-group-item>
              <mdb-list-group-item :action="true">Morbi leo risus</mdb-list-group-item>
            </mdb-list-group>
          </template>
        

          <script>
            import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
            export default {
              name: 'HorizontalListPage',
              components: {
                mdbListGroup,
                mdbListGroupItem
              }
            }
          </script>
        

Edit these docs Rate these docs

List Group - API

In this section you will find advanced information about the List Group component. You will learn which modules are required in this component, what are the possibilities of configuring the component, and what events and methods you can use in working with it.


Import statement


import { mdbListGroup, mdbListGroupItem } from 'mdbvue';
      

API Reference: Properties

Name Type Default Description Example
tag String 'ul' Changes list group's wrapper tag <mdb-list-group tag="div" />
horizontal Boolean false Changes list group's display to horizontal at all breakpoints. <mdb-list-group horizontal />
sm Boolean false Changes list group's display to horizontal at the 'sm' breakpoint. <mdb-list-group horizontal sm />
md Boolean false Changes list group's display to horizontal at the 'md' breakpoint. <mdb-list-group horizontal md />
lg Boolean false Changes list group's display to horizontal at the 'lg' breakpoint. <mdb-list-group horizontal lg />
xl Boolean false Changes list group's display to horizontal at the 'xl' breakpoint. <mdb-list-group horizontal xl />