React 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
import React from 'react';
import { ListGroup, ListGroupItem } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem>Cras justo odio</ListGroupItem>
                    <ListGroupItem>Dapibus ac facilisis in</ListGroupItem>
                    <ListGroupItem>Morbi leo risus</ListGroupItem>
                    <ListGroupItem>Porta ac consectetur ac</ListGroupItem>
                    <ListGroupItem>Vestibulum at eros</ListGroupItem>
                </ListGroup>
        );
};

export default MyListGroup;

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
import React from 'react';
import { ListGroup, ListGroupItem, Badge } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem>Cras justo odio<Badge color="primary" pill>14</Badge></ListGroupItem>
                    <ListGroupItem>Dapibus ac facilisis in<Badge color="primary" pill>2</Badge></ListGroupItem>
                    <ListGroupItem>Morbi leo risus<Badge color="primary" pill>1</Badge></ListGroupItem>
                </ListGroup>
    );
};

export default MyListGroup;

Linked items

Linkify list group items using the href prop and an optional active attribute,

import React from 'react';
import { ListGroup, ListGroupItem } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem href="#" active>Cras justo odio</ListGroupItem>
                <ListGroupItem href="#">Dapibus ac facilisis in</ListGroupItem>
                <ListGroupItem href="#">Morbi leo risus</ListGroupItem>
                <ListGroupItem href="#">Porta ac consectetur ac</ListGroupItem>
                <ListGroupItem href="#">Vestibulum at eros</ListGroupItem>
            </ListGroup>
    );
};

export default MyListGroup;

Links and buttons

To create actionable list group items with hover or disabled states use appropriate attributes, namely hover and disabled.

import React from 'react';
import { ListGroup, ListGroupItem } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem href="#" active>Cras justo odio</ListGroupItem>
                <ListGroupItem href="#" hover>Dapibus ac facilisis in</ListGroupItem>
                <ListGroupItem href="#" hover>Morbi leo risus</ListGroupItem>
                <ListGroupItem href="#" hover>Porta ac consectetur ac</ListGroupItem>
                <ListGroupItem href="#" disabled>Vestibulum at eros</ListGroupItem>
            </ListGroup>
    );
};

export default MyListGroup;

Contextual attributes

Use contextual attributes to style list items, default or linked.

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

import React from 'react';
import { ListGroup, ListGroupItem } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem>Dapibus ac facilisis in</ListGroupItem>
                <ListGroupItem>Cras justo odio</ListGroupItem>
                <ListGroupItem>Porta ac consectetur ac</ListGroupItem>
                <ListGroupItem>Vestibulum at eros</ListGroupItem>
            </ListGroup>
            <br>
            <ListGroup>
                <ListGroupItem href="#" hover>Dapibus ac facilisis in</ListGroupItem>
                <ListGroupItem href="#" active>Cras justo odio</ListGroupItem>
                <ListGroupItem href="#" hover>Porta ac consectetur ac</ListGroupItem>
                <ListGroupItem href="#" disabled>Vestibulum at eros</ListGroupItem>
            </ListGroup>
    );
};

export default MyListGroup;

Custom content

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

import React from 'react';
import { ListGroup, ListGroupItem } from 'mdbreact'

const MyListGroup = (props) => {
    return(
            <ListGroup>
                <ListGroupItem active href="#">
                    <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>
                </ListGroupItem>
                <ListGroupItem hover href="#">
                    <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>
                </ListGroupItem>
                <ListGroupItem hover href="#">
                    <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>
                </ListGroupItem>
            </ListGroup>
    );
};

export default MyListGroup;