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.
 
 
 
 

176 lines
5.3 KiB

  1. <div class="bs-docs-section">
  2. <h1 id="pagination" class="page-header">Pagination</h1>
  3. <p class="lead">Provide pagination links for your site or app with the multi-page pagination component, or the simpler <a href="#pagination-pager">pager alternative</a>.</p>
  4. <h2 id="pagination-default">Default pagination</h2>
  5. <p>Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.</p>
  6. <div class="bs-example">
  7. <nav>
  8. <ul class="pagination">
  9. <li><a href="#">&laquo;</a></li>
  10. <li><a href="#">1</a></li>
  11. <li><a href="#">2</a></li>
  12. <li><a href="#">3</a></li>
  13. <li><a href="#">4</a></li>
  14. <li><a href="#">5</a></li>
  15. <li><a href="#">&raquo;</a></li>
  16. </ul>
  17. </nav>
  18. </div>
  19. {% highlight html %}
  20. <nav>
  21. <ul class="pagination">
  22. <li><a href="#">&laquo;</a></li>
  23. <li><a href="#">1</a></li>
  24. <li><a href="#">2</a></li>
  25. <li><a href="#">3</a></li>
  26. <li><a href="#">4</a></li>
  27. <li><a href="#">5</a></li>
  28. <li><a href="#">&raquo;</a></li>
  29. </ul>
  30. </nav>
  31. {% endhighlight %}
  32. <h3>Disabled and active states</h3>
  33. <p>Links are customizable for different circumstances. Use <code>.disabled</code> for unclickable links and <code>.active</code> to indicate the current page.</p>
  34. <div class="bs-example">
  35. <nav>
  36. <ul class="pagination">
  37. <li class="disabled"><a href="#">&laquo;</a></li>
  38. <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
  39. <li><a href="#">2</a></li>
  40. <li><a href="#">3</a></li>
  41. <li><a href="#">4</a></li>
  42. <li><a href="#">5</a></li>
  43. <li><a href="#">&raquo;</a></li>
  44. </ul>
  45. </nav>
  46. </div>
  47. {% highlight html %}
  48. <nav>
  49. <ul class="pagination">
  50. <li class="disabled"><a href="#">&laquo;</a></li>
  51. <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
  52. ...
  53. </ul>
  54. </nav>
  55. {% endhighlight %}
  56. <p>You can optionally swap out active or disabled anchors for <code>&lt;span&gt;</code> to remove click functionality while retaining intended styles.</p>
  57. {% highlight html %}
  58. <nav>
  59. <ul class="pagination">
  60. <li class="disabled"><span>&laquo;</span></li>
  61. <li class="active"><span>1 <span class="sr-only">(current)</span></span></li>
  62. ...
  63. </ul>
  64. </nav>
  65. {% endhighlight %}
  66. <h3>Sizing</h3>
  67. <p>Fancy larger or smaller pagination? Add <code>.pagination-lg</code> or <code>.pagination-sm</code> for additional sizes.</p>
  68. <div class="bs-example">
  69. <nav>
  70. <ul class="pagination pagination-lg">
  71. <li><a href="#">&laquo;</a></li>
  72. <li><a href="#">1</a></li>
  73. <li><a href="#">2</a></li>
  74. <li><a href="#">3</a></li>
  75. <li><a href="#">4</a></li>
  76. <li><a href="#">5</a></li>
  77. <li><a href="#">&raquo;</a></li>
  78. </ul>
  79. </nav>
  80. <nav>
  81. <ul class="pagination">
  82. <li><a href="#">&laquo;</a></li>
  83. <li><a href="#">1</a></li>
  84. <li><a href="#">2</a></li>
  85. <li><a href="#">3</a></li>
  86. <li><a href="#">4</a></li>
  87. <li><a href="#">5</a></li>
  88. <li><a href="#">&raquo;</a></li>
  89. </ul>
  90. </nav>
  91. <nav>
  92. <ul class="pagination pagination-sm">
  93. <li><a href="#">&laquo;</a></li>
  94. <li><a href="#">1</a></li>
  95. <li><a href="#">2</a></li>
  96. <li><a href="#">3</a></li>
  97. <li><a href="#">4</a></li>
  98. <li><a href="#">5</a></li>
  99. <li><a href="#">&raquo;</a></li>
  100. </ul>
  101. </nav>
  102. </div>
  103. {% highlight html %}
  104. <nav><ul class="pagination pagination-lg">...</ul></nav>
  105. <nav><ul class="pagination">...</ul></nav>
  106. <nav><ul class="pagination pagination-sm">...</ul></nav>
  107. {% endhighlight %}
  108. <h2 id="pagination-pager">Pager</h2>
  109. <p>Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.</p>
  110. <h3>Default example</h3>
  111. <p>By default, the pager centers links.</p>
  112. <div class="bs-example">
  113. <nav>
  114. <ul class="pager">
  115. <li><a href="#">Previous</a></li>
  116. <li><a href="#">Next</a></li>
  117. </ul>
  118. </nav>
  119. </div>
  120. {% highlight html %}
  121. <nav>
  122. <ul class="pager">
  123. <li><a href="#">Previous</a></li>
  124. <li><a href="#">Next</a></li>
  125. </ul>
  126. </nav>
  127. {% endhighlight %}
  128. <h3>Aligned links</h3>
  129. <p>Alternatively, you can align each link to the sides:</p>
  130. <div class="bs-example">
  131. <nav>
  132. <ul class="pager">
  133. <li class="previous"><a href="#">&larr; Older</a></li>
  134. <li class="next"><a href="#">Newer &rarr;</a></li>
  135. </ul>
  136. </nav>
  137. </div>
  138. {% highlight html %}
  139. <nav>
  140. <ul class="pager">
  141. <li class="previous"><a href="#">&larr; Older</a></li>
  142. <li class="next"><a href="#">Newer &rarr;</a></li>
  143. </ul>
  144. </nav>
  145. {% endhighlight %}
  146. <h3>Optional disabled state</h3>
  147. <p>Pager links also use the general <code>.disabled</code> utility class from the pagination.</p>
  148. <div class="bs-example">
  149. <nav>
  150. <ul class="pager">
  151. <li class="previous disabled"><a href="#">&larr; Older</a></li>
  152. <li class="next"><a href="#">Newer &rarr;</a></li>
  153. </ul>
  154. </nav>
  155. </div>
  156. {% highlight html %}
  157. <nav>
  158. <ul class="pager">
  159. <li class="previous disabled"><a href="#">&larr; Older</a></li>
  160. <li class="next"><a href="#">Newer &rarr;</a></li>
  161. </ul>
  162. </nav>
  163. {% endhighlight %}
  164. </div>