List group
Vue Bootstrap 5 List group component
List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within.
Note: Read the API tab to find all available options and advanced customization
Basic example
The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
Active items
Add active
prop to a MDBListGroupItem
to indicate the current active
selection.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
Disabled items
Add disabled
to a MDBListGroupItem
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).
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
Flush
Add flush
prop to remove some borders and rounded corners to render list group
items edge-to-edge in a parent container (e.g., cards).
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
Numbered
Add the numbered
property to opt into numbered list group items. Numbers are generated
via CSS (as opposed to a <ol>
s default browser styling) for better
placement inside list group items and to allow for better customization.
Numbers are generated by counter-reset
on the <ol>
, and then
styled and placed with a ::before
psuedo-element on the
<li>
with counter-increment
and content
.
- Cras justo odio
- Cras justo odio
- Cras justo odio
These work great with custom content as well.
-
SubheadingCras justo odio
-
SubheadingCras justo odio
-
SubheadingCras justo odio
Horizontal
Add horizontal
to change the layout of list group items from vertical to
horizontal across all breakpoints. Alternatively, choose a responsive variant
horizontal={sm|md|lg|xl|xxl}
to make a list group horizontal starting at that
breakpoint’s min-width
. Currently
horizontal list groups cannot be combined with flush list groups.
ProTip: Want equal-width list group items when horizontal? Add
.flex-fill
to each list group item.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
Contextual props
Use contextual color
props to style list items with a stateful background and
color.
- Dapibus ac facilisis in
- A simple primary list group item
- A simple secondary list group item
- A simple success list group item
- A simple danger list group item
- A simple warning list group item
- A simple info list group item
- A simple light list group item
- A simple dark list group item
Contextual props also work with
MDBListGroupItem action
. Note the addition of the hover styles here not present
in the previous example. Also supported is the active
state; apply it to indicate
an active selection on a contextual list group item.
Conveying meaning to assistive technologies:
Using color to add meaning only provides a visual indication, which will not be conveyed to
users of assistive technologies – such as screen readers. Ensure that information denoted by
the color is either obvious from the content itself (e.g. the visible text), or is included
through alternative means, such as additional text hidden with the
.visually-hidden
class.
Badges
Add badges to any list group item to show unread counts, activity, and more with the help of some flexbox utilities.
- Cras justo odio 14
- Dapibus ac facilisis in 2
- Morbi leo risus 1
Custom content
Add nearly any HTML within, even for linked list groups like the one below, with the help of flexbox utilities.
List group item heading
3 days agoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.List group item heading
3 days agoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.List group item heading
3 days agoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Checkboxes
Place Bootstrap’s checkboxes and radios within list group items and customize as needed. You
can use them without <label>
s, but please remember to include an
aria-label
attribute and value for accessibility.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
And if you want <label>
s as the MDBListGroupItem
for large hit
areas, you can do that, too.
List group - API
Import
Properties
MDBListGroup
Name | Type | Default | Description | Example |
---|---|---|---|---|
tag
|
String | 'ul' |
Defines tag of the MDBListGroup element |
<MDBListGroup tag="section" />
|
horizontal
|
Boolean | String | false |
Changes list group's display to horizontal at all breakpoints when no value is
passed and to a specific breakpoint when a value is passed. Use
(sm | md | lg | xl | ) values
|
<MDBListGroup horizontal />
<MDBListGroup horizontal="md" />
|
flush
|
Boolean | false |
Removes list's borders |
<MDBListGroup flush />
|
numbered
|
Boolean | false |
Adds list item numeration |
<MDBListGroup numbered />
|
MDBListGroupItem
Name | Type | Default | Description | Example |
---|---|---|---|---|
tag
|
String | 'li' |
Defines tag of the MDBListGroupItem element |
<MDBListGroupItem tag="div" />
|
color
|
String |
|
Changes the list item's style according to the passed value (primary, warning, danger, secondary, success, light, dark) or background to the given color (primary-color, light-blue, pink, etc) |
<MDBListGroupItem color="danger" />
|
active
|
Boolean | false |
Sets item active |
<MDBListGroupItem active />
|
disabled
|
Boolean | false |
Sets item disabled |
<MDBListGroupItem disabled />
|
action
|
Boolean | false |
Changes list group item's styling to action |
<MDBListGroupItem action />
|