diff --git a/docs/_includes/docs-nav.html b/docs/_includes/docs-nav.html
index 4a91214a38..652b845cd8 100644
--- a/docs/_includes/docs-nav.html
+++ b/docs/_includes/docs-nav.html
@@ -163,12 +163,25 @@
Media object
+
+ List group
+
+
Panels
Wells
diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css
index b86a16a788..fcbc5d5808 100644
--- a/docs/assets/css/bootstrap.css
+++ b/docs/assets/css/bootstrap.css
@@ -2944,6 +2944,80 @@ fieldset[disabled] .btn-link:focus {
z-index: 1051;
}
+.list-group {
+ margin: 0 0 20px;
+ background-color: #ffffff;
+}
+
+.list-group-item {
+ position: relative;
+ display: block;
+ padding: 10px 30px 10px 15px;
+ margin-bottom: -1px;
+ border: 1px solid #dddddd;
+}
+
+.list-group-item:first-child {
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+}
+
+.list-group-item:last-child {
+ margin-bottom: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+
+.list-group-item-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+
+.list-group-item-text {
+ margin-bottom: 0;
+ line-height: 1.3;
+}
+
+a.list-group-item .list-group-item-heading {
+ color: #333;
+}
+
+a.list-group-item .list-group-item-text {
+ color: #555;
+}
+
+a.list-group-item:hover,
+a.list-group-item:focus {
+ text-decoration: none;
+ background-color: #f5f5f5;
+}
+
+a.list-group-item.active {
+ z-index: 2;
+ color: #ffffff;
+ background-color: #428bca;
+ border-color: #428bca;
+}
+
+a.list-group-item.active .list-group-item-heading,
+a.list-group-item.active .list-group-item-text {
+ color: inherit;
+}
+
+.list-group-item > .badge,
+.list-group-item > .glyphicon-chevron-right {
+ float: right;
+ margin-right: -15px;
+}
+
+.list-group-item > .glyphicon-chevron-right {
+ margin-right: -15px;
+}
+
+.list-group-item > .glyphicon + .badge {
+ margin-right: 5px;
+}
+
.panel {
padding: 15px;
margin-bottom: 20px;
@@ -3006,6 +3080,23 @@ fieldset[disabled] .btn-link:focus {
border-color: #bce8f1;
}
+.list-group-flush {
+ margin: 15px -15px -15px;
+}
+
+.list-group-flush .list-group-item {
+ border-width: 1px 0;
+}
+
+.list-group-flush .list-group-item:first-child {
+ border-top-right-radius: 0;
+ border-top-left-radius: 0;
+}
+
+.list-group-flush .list-group-item:last-child {
+ border-bottom: 0;
+}
+
.well {
min-height: 20px;
padding: 19px;
diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css
index 181a3a734e..e1fd6a2b45 100644
--- a/docs/assets/css/docs.css
+++ b/docs/assets/css/docs.css
@@ -311,6 +311,7 @@ section > ul li {
.bs-docs-example > .jumbotron:last-child,
.bs-docs-example > .alert:last-child,
.bs-docs-example > .panel:last-child,
+.bs-docs-example > .list-group:last-child,
.bs-docs-example > .well:last-child {
margin-bottom: 0;
}
@@ -339,6 +340,10 @@ section > ul li {
margin: 0;
}
+/* List groups */
+.bs-docs-example > .list-group {
+ max-width: 400px;
+}
/* Navbar examples */
.bs-navbar-top-example,
diff --git a/docs/docs.html b/docs/docs.html
index 7603d2ccc3..844a467d2b 100644
--- a/docs/docs.html
+++ b/docs/docs.html
@@ -4369,6 +4369,172 @@ For example, <section>
should be wrapped as inline.
+
+
+
+
List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
+
+
Basic list group
+
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
+
+
+{% highlight html linenos %}
+
+ - Cras justo odio
+ - Dapibus ac facilisis in
+ - Morbi leo risus
+ - Porta ac consectetur ac
+ - Vestibulum at eros
+
+{% endhighlight %}
+
+
With chevrons
+
Adding Glyphicon chevrons are automatically moved to the right.
+
+
+ -
+
+ Cras justo odio
+
+ -
+
+ Dapibus ac facilisis in
+
+ -
+
+ Morbi leo risus
+
+
+
+{% highlight html linenos %}
+
+ -
+
+ Cras justo odio
+
+
+{% endhighlight %}
+
+
With badges
+
Add the badges component to any list group item and it will automatically be positioned on the right.
+
+
+ -
+ 14
+ Cras justo odio
+
+ -
+ 2
+ Dapibus ac facilisis in
+
+ -
+ 1
+ Morbi leo risus
+
+
+
+{% highlight html linenos %}
+
+ -
+ 14
+ Cras justo odio
+
+
+{% endhighlight %}
+
+
With badges and chevrons
+
Why not both?
+
+
+ -
+
+ 14
+ Cras justo odio
+
+ -
+
+ 2
+ Dapibus ac facilisis in
+
+ -
+
+ 1
+ Morbi leo risus
+
+
+
+{% highlight html linenos %}
+
+ -
+
+ 14
+ Cras justo odio
+
+
+{% endhighlight %}
+
+
Linked list group
+
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.
+
+{% highlight html linenos %}
+
+{% endhighlight %}
+
+
Custom content
+
Add nearly any HTML within, even for linked list groups like the one below.
+
+{% highlight html linenos %}
+
+{% endhighlight %}
+
+
+
+
+
@@ -4430,6 +4596,31 @@ For example,
<section>
should be wrapped as inline.
...
...
...
+{% endhighlight %}
+
+
With list groups
+
Easily include full-width list groups within any panel.
+
+
+
+
Panel heading
+
Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.
+
+
+
+ - Cras justo odio
+ - Dapibus ac facilisis in
+ - Morbi leo risus
+ - Porta ac consectetur ac
+ - Vestibulum at eros
+
+
+
+{% highlight html linenos %}
+
+
Panel heading
+ Panel content
+
{% endhighlight %}
diff --git a/less/bootstrap.less b/less/bootstrap.less
index c887fcef6f..c73c85c385 100644
--- a/less/bootstrap.less
+++ b/less/bootstrap.less
@@ -30,6 +30,7 @@
@import "component-animations.less";
@import "glyphicons.less";
@import "dropdowns.less";
+@import "list-group.less";
@import "panels.less";
@import "wells.less";
@import "close.less";
diff --git a/less/list-group.less b/less/list-group.less
new file mode 100644
index 0000000000..23ddb0d47e
--- /dev/null
+++ b/less/list-group.less
@@ -0,0 +1,94 @@
+//
+// List groups
+// --------------------------------------------------
+
+// Base class
+//
+// Easily usable on , , or .
+.list-group {
+ // No need to set list-style: none; since .list-group-item is block level
+ margin: 0 0 20px; // reset all margins because ul and ol
+ background-color: @list-group-bg;
+}
+
+// Individual list items
+// -------------------------
+
+.list-group-item {
+ position: relative;
+ display: block;
+ padding: 10px 30px 10px 15px;
+ // Place the border on the list items and negative margin up for better styling
+ margin-bottom: -1px;
+ border: 1px solid @list-group-border;
+}
+// Round the first and last items
+.list-group-item:first-child {
+ .border-top-radius(@border-radius-base);
+}
+.list-group-item:last-child {
+ margin-bottom: 0;
+ .border-bottom-radius(@border-radius-base);
+}
+
+
+// Custom content options
+// -------------------------
+
+.list-group-item-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+.list-group-item-text {
+ margin-bottom: 0;
+ line-height: 1.3;
+}
+
+// Linked list items
+// -------------------------
+
+// Custom content within linked items
+a.list-group-item {
+ .list-group-item-heading {
+ color: #333;
+ }
+ .list-group-item-text {
+ color: #555;
+ }
+}
+
+// Hover state
+a.list-group-item:hover,
+a.list-group-item:focus {
+ text-decoration: none;
+ background-color: @list-group-hover-bg;
+}
+
+// Active class on item itself, not parent
+a.list-group-item.active {
+ z-index: 2; // Place active items above their siblings for proper border styling
+ color: @list-group-active-text;
+ background-color: @list-group-active-bg;
+ border-color: @list-group-active-border;
+
+ // Force color to inherit for custom content
+ .list-group-item-heading,
+ .list-group-item-text {
+ color: inherit;
+ }
+}
+
+// Chevrons and badges within list items
+// -------------------------
+
+.list-group-item > .badge,
+.list-group-item > .glyphicon-chevron-right {
+ float: right;
+ margin-right: -15px;
+}
+.list-group-item > .glyphicon-chevron-right {
+ margin-right: -15px;
+}
+.list-group-item > .glyphicon + .badge {
+ margin-right: 5px;
+}
diff --git a/less/panels.less b/less/panels.less
index 43e5199223..6c9dd6df37 100644
--- a/less/panels.less
+++ b/less/panels.less
@@ -58,3 +58,21 @@
border-color: @panel-info-border;
}
}
+
+// List groups in panels
+.list-group-flush {
+ margin: 15px -15px -15px;
+
+ .list-group-item {
+ border-width: 1px 0;
+
+ // Remove border radius for top one
+ &:first-child {
+ .border-top-radius(0);
+ }
+ // But keep it for the last one
+ &:last-child {
+ border-bottom: 0;
+ }
+ }
+}
diff --git a/less/variables.less b/less/variables.less
index c4b85d80e1..054d2d69e3 100644
--- a/less/variables.less
+++ b/less/variables.less
@@ -293,6 +293,17 @@
@progress-bar-info-bg: @brand-info;
+// List group
+// -------------------------
+@list-group-bg: #fff;
+@list-group-border: #ddd;
+@list-group-border-radius: @border-radius-base;
+
+@list-group-hover-bg: #f5f5f5;
+@list-group-active-text: #fff;
+@list-group-active-bg: @link-color;
+@list-group-active-border: @list-group-active-bg;
+
// Panels
// -------------------------
@panel-bg: #fff;