Components (7): List group
ul.list-group
Attribute
style="width: 320px;"
li.list-group-item
Cras justo odio
ul.list-group
sets a width to 100% inside a parent. You can use the same techniques as setting sizes of cards (see Cards - Sizing).Add .active
to an active item. See example below (set to the first item).
Add .disabled
to a disabled item. See example below (set to the first item).
An interactive list group can be built with a parent div.list-group
and items (a|button).list-group-item
div.list-group
(a|button).list-group-item
Attribute
.list-group-item-action
to respond to hoverExample for a
: a.list-group-item.list-group-item-action(.active)
Example for button
: button.list-group-item.list-group-item-action(.active)
Add .list-group-flush
to remove rounded border.
ul.list-group.list-group-flush
Add .list-group-item-(primary|secondary|success|...)
to items.
.list-group-item-primary
This is a primary list group item
.list-group-item-secondary
This is a secondary list group item
.list-group-item-success
This is a success list group item
.list-group-item-danger
This is a danger list group item
.list-group-item-warning
This is a warning list group item
.list-group-item-info
This is a info list group item
.list-group-item-light
This is a light list group item
.list-group-item-dark
This is a dark list group item
Example with adding .list-item-group-action
(responds to hover)
.list-group-item-primary
This is a primary list group item
.list-group-item-secondary
This is a secondary list group item
.list-group-item-success
This is a success list group item
.list-group-item-danger
This is a danger list group item
.list-group-item-warning
This is a warning list group item
.list-group-item-info
This is a info list group item
.list-group-item-light
This is a light list group item
.list-group-item-dark
This is a dark list group item
Example using badges
ul.list-group
Attribute
style="width: 320px;"
li.list-group-item
Attributes
.d-flex
(see Flex).justify-content-between
.align-items-center
Cras justo odio
span.badge.badge-primary.badge-pill
14
Example using Flex utilities
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.div.list-group
a
Attributes
.active
(first item only).flex-column
.align-items-start
div
Attributes
.d-flex
.w-100
.justify-content-between
h5
(justified to leftmost)
List group item heading ...
small
(justified to rightmost)
3 days ago
p
Donec id elit non mi porta gravida at eget ...
small
Donec id elit non mi porta.
You can build tabbable panes with a list group (using bootstrap.js) as follows.
div.list-group
Attribute
role="tablist"
a.list-group-item(.list-group-item-action)?
Attributes
.active
to an initially-visible itemid="{item-id}"
data-toggle="list"
href="#{content-id}"
role="tab"
aria-controls="{content-id}"
div.tab-content
div.tab-pane(.fade)
Attributes
.fade
for animation (fade in/out) effect.show.active
to an initially-visible itemid="{content-id}"
role="tabpanel"
aria-labelledby="{item-id}"