You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

168 lines
7.0 KiB

  1. <div class="bs-docs-section">
  2. <h1 id="list-group" class="page-header">List group</h1>
  3. <p class="lead">List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.</p>
  4. <h3 id="list-group-basic">Basic example</h3>
  5. <p>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.</p>
  6. <div class="bs-example">
  7. <ul class="list-group">
  8. <li class="list-group-item">Cras justo odio</li>
  9. <li class="list-group-item">Dapibus ac facilisis in</li>
  10. <li class="list-group-item">Morbi leo risus</li>
  11. <li class="list-group-item">Porta ac consectetur ac</li>
  12. <li class="list-group-item">Vestibulum at eros</li>
  13. </ul>
  14. </div>
  15. {% highlight html %}
  16. <ul class="list-group">
  17. <li class="list-group-item">Cras justo odio</li>
  18. <li class="list-group-item">Dapibus ac facilisis in</li>
  19. <li class="list-group-item">Morbi leo risus</li>
  20. <li class="list-group-item">Porta ac consectetur ac</li>
  21. <li class="list-group-item">Vestibulum at eros</li>
  22. </ul>
  23. {% endhighlight %}
  24. <h3 id="list-group-badges">Badges</h3>
  25. <p>Add the badges component to any list group item and it will automatically be positioned on the right.</p>
  26. <div class="bs-example">
  27. <ul class="list-group">
  28. <li class="list-group-item">
  29. <span class="badge">14</span>
  30. Cras justo odio
  31. </li>
  32. <li class="list-group-item">
  33. <span class="badge">2</span>
  34. Dapibus ac facilisis in
  35. </li>
  36. <li class="list-group-item">
  37. <span class="badge">1</span>
  38. Morbi leo risus
  39. </li>
  40. </ul>
  41. </div>
  42. {% highlight html %}
  43. <ul class="list-group">
  44. <li class="list-group-item">
  45. <span class="badge">14</span>
  46. Cras justo odio
  47. </li>
  48. </ul>
  49. {% endhighlight %}
  50. <h3 id="list-group-linked">Linked items</h3>
  51. <p>Linkify list group items by using anchor tags instead of list items (that also means a parent <code>&lt;div&gt;</code> instead of an <code>&lt;ul&gt;</code>). No need for individual parents around each element.</p>
  52. <div class="bs-example">
  53. <div class="list-group">
  54. <a href="#" class="list-group-item active">
  55. Cras justo odio
  56. </a>
  57. <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
  58. <a href="#" class="list-group-item">Morbi leo risus</a>
  59. <a href="#" class="list-group-item">Porta ac consectetur ac</a>
  60. <a href="#" class="list-group-item">Vestibulum at eros</a>
  61. </div>
  62. </div>
  63. {% highlight html %}
  64. <div class="list-group">
  65. <a href="#" class="list-group-item active">
  66. Cras justo odio
  67. </a>
  68. <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
  69. <a href="#" class="list-group-item">Morbi leo risus</a>
  70. <a href="#" class="list-group-item">Porta ac consectetur ac</a>
  71. <a href="#" class="list-group-item">Vestibulum at eros</a>
  72. </div>
  73. {% endhighlight %}
  74. <h3 id="list-group-disabled">Disabled items</h3>
  75. <p>Add <code>.disabled</code> to a <code>.list-group-item</code> to gray it out to appear disabled.</p>
  76. <div class="bs-example">
  77. <div class="list-group">
  78. <a href="#" class="list-group-item disabled">
  79. Cras justo odio
  80. </a>
  81. <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
  82. <a href="#" class="list-group-item">Morbi leo risus</a>
  83. <a href="#" class="list-group-item">Porta ac consectetur ac</a>
  84. <a href="#" class="list-group-item">Vestibulum at eros</a>
  85. </div>
  86. </div>
  87. {% highlight html %}
  88. <div class="list-group">
  89. <a href="#" class="list-group-item disabled">
  90. Cras justo odio
  91. </a>
  92. <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
  93. <a href="#" class="list-group-item">Morbi leo risus</a>
  94. <a href="#" class="list-group-item">Porta ac consectetur ac</a>
  95. <a href="#" class="list-group-item">Vestibulum at eros</a>
  96. </div>
  97. {% endhighlight %}
  98. <h3 id="list-group-contextual-classes">Contextual classes</h3>
  99. <p>Use contextual classes to style list items, default or linked. Also includes <code>.active</code> state.</p>
  100. <div class="bs-example">
  101. <div class="row">
  102. <div class="col-sm-6">
  103. <ul class="list-group">
  104. <li class="list-group-item list-group-item-success">Dapibus ac facilisis in</li>
  105. <li class="list-group-item list-group-item-info">Cras sit amet nibh libero</li>
  106. <li class="list-group-item list-group-item-warning">Porta ac consectetur ac</li>
  107. <li class="list-group-item list-group-item-danger">Vestibulum at eros</li>
  108. </ul>
  109. </div>
  110. <div class="col-sm-6">
  111. <div class="list-group">
  112. <a href="#" class="list-group-item list-group-item-success">Dapibus ac facilisis in</a>
  113. <a href="#" class="list-group-item list-group-item-info">Cras sit amet nibh libero</a>
  114. <a href="#" class="list-group-item list-group-item-warning">Porta ac consectetur ac</a>
  115. <a href="#" class="list-group-item list-group-item-danger">Vestibulum at eros</a>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. {% highlight html %}
  121. <ul class="list-group">
  122. <li class="list-group-item list-group-item-success">Dapibus ac facilisis in</li>
  123. <li class="list-group-item list-group-item-info">Cras sit amet nibh libero</li>
  124. <li class="list-group-item list-group-item-warning">Porta ac consectetur ac</li>
  125. <li class="list-group-item list-group-item-danger">Vestibulum at eros</li>
  126. </ul>
  127. <div class="list-group">
  128. <a href="#" class="list-group-item list-group-item-success">Dapibus ac facilisis in</a>
  129. <a href="#" class="list-group-item list-group-item-info">Cras sit amet nibh libero</a>
  130. <a href="#" class="list-group-item list-group-item-warning">Porta ac consectetur ac</a>
  131. <a href="#" class="list-group-item list-group-item-danger">Vestibulum at eros</a>
  132. </div>
  133. {% endhighlight %}
  134. <h3 id="list-group-custom-content">Custom content</h3>
  135. <p>Add nearly any HTML within, even for linked list groups like the one below.</p>
  136. <div class="bs-example">
  137. <div class="list-group">
  138. <a href="#" class="list-group-item active">
  139. <h4 class="list-group-item-heading">List group item heading</h4>
  140. <p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
  141. </a>
  142. <a href="#" class="list-group-item">
  143. <h4 class="list-group-item-heading">List group item heading</h4>
  144. <p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
  145. </a>
  146. <a href="#" class="list-group-item">
  147. <h4 class="list-group-item-heading">List group item heading</h4>
  148. <p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
  149. </a>
  150. </div>
  151. </div>
  152. {% highlight html %}
  153. <div class="list-group">
  154. <a href="#" class="list-group-item active">
  155. <h4 class="list-group-item-heading">List group item heading</h4>
  156. <p class="list-group-item-text">...</p>
  157. </a>
  158. </div>
  159. {% endhighlight %}
  160. </div>