mdb-ui-kit/docs/material-design/list-group.md

269 lines
7.7 KiB
Markdown
Raw Normal View History

---
layout: docs
title: List group
group: material-design
---
Material design list groups are specialized versions of their bootstrap counterparts, opting for the flexbox layout to achieve
the varieties specified. ([Specification](https://www.google.com/design/spec/components/lists.html#lists-specs))
The material classes introduced are:
<table>
<thead>
<tr>
<th>Classes</th>
<th>BS Equivalent</th>
<th>Differences</th>
</tr>
</thead>
<tbody>
<tr>
<td>
2015-12-23 19:31:49 +03:00
<code>.mdb-list-group-item</code>
</td>
<td class="text-nowrap">
2015-12-23 19:31:49 +03:00
<code>.list-group-item</code>
</td>
<td>
{% markdown %}Flexbox layout, including conveniences for icon and label layout.{% endmarkdown %}
</td>
</tr>
<tr>
<td>
2015-12-23 19:31:49 +03:00
<code>.mdb-list-group-col</code>
</td>
<td class="text-nowrap">
{% markdown %}None{% endmarkdown %}
</td>
<td>
2015-12-23 19:31:49 +03:00
{% markdown %}Flexbox column - additional class to use within an `.mdb-list-group-item` for layout, such as a multi-line content section.{% endmarkdown %}
</td>
</tr>
<tr>
<td>
2015-12-23 19:31:49 +03:00
<code>.right</code>
</td>
<td class="text-nowrap">
{% markdown %}None{% endmarkdown %}
</td>
<td>
{% markdown %}Flex layout marker - additional class needed when only one icon/label is present and it should be right aligned. Only valid as a child of `.mdb-list-group-item`{% endmarkdown %}
</td>
</tr>
<tr>
<td>
2015-12-23 19:31:49 +03:00
<code>.mdb-list-group-sm</code>
</td>
<td class="text-nowrap">
{% markdown %}None{% endmarkdown %}
</td>
<td>
{% markdown %}Use on `.mdb-list-group` for the dense list display{% endmarkdown %}
</td>
</tr>
</tbody>
</table>
## Contents
* Will be replaced with the ToC, excluding the "Contents" header
{:toc}
## Single line
### Text
{% example html %}
<ul class="list-group">
2015-12-23 19:31:49 +03:00
<li class="mdb-list-group-item">Text only</li>
<a href="#" class="mdb-list-group-item">Link item</a>
<button type="button" class="mdb-list-group-item">Button item</button>
2015-12-23 19:31:49 +03:00
<a href="#" class="mdb-list-group-item active">Active link item</a>
<a href="#" class="mdb-list-group-item disabled">Disabled item</a>
</ul>
{% endexample %}
### Dense
{% example html %}
<ul class="list-group mdb-list-group-sm">
2015-12-23 19:31:49 +03:00
<li class="mdb-list-group-item">Text</li>
<a href="#" class="mdb-list-group-item">Link item</a>
<button type="button" class="mdb-list-group-item">Button item</button>
2015-12-23 19:31:49 +03:00
<a href="#" class="mdb-list-group-item active">Active link item</a>
<a href="#" class="mdb-list-group-item disabled">Disabled item</a>
</ul>
{% endexample %}
### Icons and labels
{% example html %}
<ul class="list-group">
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<i class="material-icons">inbox</i>
Icon left
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<span class="label label-default label-pill">14</span>
Label pill left
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<i class="material-icons">inbox</i>
Icons left and right
<i class="material-icons">face</i>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<span class="label label-default label-pill">14</span>
Label pill left and right
<span class="label label-default label-pill">14</span>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
Icon <code>.right</code>
<i class="material-icons right">face</i>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
Label pill <code>.right</code>
<span class="label label-default label-pill right">14</span>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<span class="label label-default label-pill">14</span>
Label pill and icon
<i class="material-icons">inbox</i>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<i class="material-icons">inbox</i>
Icon and label pill
<span class="label label-default label-pill">14</span>
2015-12-23 19:31:49 +03:00
</a>
</ul>
{% endexample %}
## Double line
### Text
{% example html %}
<ul class="list-group">
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
</ul>
{% endexample %}
### Dense
{% example html %}
<ul class="list-group mdb-list-group-sm">
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Some text</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
</ul>
{% endexample %}
### Icons and labels
{% example html %}
<ul class="list-group">
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<i class="material-icons">inbox</i>
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Icon left</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<span class="label label-default label-pill">14</span>
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Icon left</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<i class="material-icons">inbox</i>
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Icons left and right</p>
</div>
<i class="material-icons">face</i>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Icon right</p>
</div>
<i class="material-icons right">face</i>
2015-12-23 19:31:49 +03:00
</a>
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
<p class="list-group-item-heading">List group item heading</p>
<p class="list-group-item-text">Label pill to the right</p>
</div>
<span class="label label-default label-pill right">14</span>
2015-12-23 19:31:49 +03:00
</a>
</ul>
{% endexample %}
## Three line
### Text
{% example html %}
<ul class="list-group">
2015-12-23 19:31:49 +03:00
<a class="mdb-list-group-item">
<div class="mdb-list-group-col">
2015-12-23 19:31:49 +03:00
<p class="list-group-item-heading">Linked list group item heading</p>
<p class="list-group-item-text">This disallows more than two lines. Hopefully an ellipsis ends this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut malesuada elit. Proin tristique, lorem eu vehicula congue, lectus ipsum porta quam, eget rutrum sapien turpis et libero.</p>
</div>
2015-12-23 19:31:49 +03:00
</a>
<li class="mdb-list-group-item">
<div class="mdb-list-group-col">
2015-12-23 19:31:49 +03:00
<p class="list-group-item-heading">Text list group item heading</p>
<p class="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut malesuada elit. Proin tristique, lorem eu vehicula congue, lectus ipsum porta quam, eget rutrum sapien turpis et libero.</p>
</div>
</li>
</ul>
{% endexample %}