2014-03-17 03:03:53 +01:00
< div class = "bs-docs-section" >
< h1 id = "pagination" class = "page-header" > Pagination< / h1 >
< 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 >
< h2 id = "pagination-default" > Default pagination< / h2 >
< 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 >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "simple-pagination" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "Page navigation" >
2014-09-09 05:34:26 +02:00
< ul class = "pagination" >
2014-11-30 03:27:51 +01:00
< li >
2014-12-08 15:54:20 +01:00
< a href = "#" aria-label = "Previous" >
2014-11-30 03:27:51 +01:00
< span aria-hidden = "true" > « < / span >
< / a >
< / li >
2014-09-09 05:34:26 +02:00
< li > < a href = "#" > 1< / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-11-30 03:27:51 +01:00
< li >
2014-12-08 15:54:20 +01:00
< a href = "#" aria-label = "Next" >
2014-11-30 03:27:51 +01:00
< span aria-hidden = "true" > » < / span >
< / a >
< / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "Page navigation" >
2014-09-09 05:34:26 +02:00
< ul class = "pagination" >
2014-11-30 03:27:51 +01:00
< li >
2014-12-08 15:54:20 +01:00
< a href = "#" aria-label = "Previous" >
2014-11-30 03:27:51 +01:00
< span aria-hidden = "true" > « < / span >
< / a >
< / li >
2014-09-09 05:34:26 +02:00
< li > < a href = "#" > 1< / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-11-30 03:27:51 +01:00
< li >
2014-12-08 15:54:20 +01:00
< a href = "#" aria-label = "Next" >
2014-11-30 03:27:51 +01:00
< span aria-hidden = "true" > » < / span >
< / a >
< / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
2016-04-10 15:54:05 +02:00
< div class = "bs-callout bs-callout-info" id = "callout-pagination-label" >
< h4 > Labelling the pagination component< / h4 >
< p > The pagination component should be wrapped in a < code > < nav> < / code > element to identify it as a navigation section to screen readers and other assistive technologies. In addition, as a page is likely to have more than one such navigation section already (such as the primary navigation in the header, or a sidebar navigation), it is advisable to provide a descriptive < code > aria-label< / code > for the < code > < nav> < / code > which reflects its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be < code > aria-label="Search results pages"< / code > .< / p >
< / div >
2014-03-17 03:03:53 +01:00
< h3 > Disabled and active states< / h3 >
< p > Links are customizable for different circumstances. Use < code > .disabled< / code > for unclickable links and < code > .active< / code > to indicate the current page.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "disabled-active-pagination" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pagination" >
2014-12-08 15:54:20 +01:00
< li class = "disabled" > < a href = "#" aria-label = "Previous" > < span aria-hidden = "true" > « < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< li class = "active" > < a href = "#" > 1 < span class = "sr-only" > (current)< / span > < / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Next" > < span aria-hidden = "true" > » < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pagination" >
2014-12-08 15:54:20 +01:00
< li class = "disabled" > < a href = "#" aria-label = "Previous" > < span aria-hidden = "true" > « < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< li class = "active" > < a href = "#" > 1 < span class = "sr-only" > (current)< / span > < / a > < / li >
...
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
2014-10-30 17:45:33 +01:00
< p > You can optionally swap out active or disabled anchors for < code > < span> < / code > , or omit the anchor in the case of the previous/next arrows, to remove click functionality while retaining intended styles.< / p >
2014-03-17 03:03:53 +01:00
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pagination" >
2014-11-30 03:27:51 +01:00
< li class = "disabled" >
< span >
< span aria-hidden = "true" > « < / span >
< / span >
< / li >
< li class = "active" >
< span > 1 < span class = "sr-only" > (current)< / span > < / span >
< / li >
2014-09-09 05:34:26 +02:00
...
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
< h3 > Sizing< / h3 >
< p > Fancy larger or smaller pagination? Add < code > .pagination-lg< / code > or < code > .pagination-sm< / code > for additional sizes.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "pagination-sizing" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-03-17 03:03:53 +01:00
< ul class = "pagination pagination-lg" >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Previous" > < span aria-hidden = "true" > « < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< li > < a href = "#" > 1< / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Next" > < span aria-hidden = "true" > » < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< / ul >
2014-09-09 05:34:26 +02:00
< / nav >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-03-17 03:03:53 +01:00
< ul class = "pagination" >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Previous" > < span aria-hidden = "true" > « < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< li > < a href = "#" > 1< / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Next" > < span aria-hidden = "true" > » < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< / ul >
2014-09-09 05:34:26 +02:00
< / nav >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-03-17 03:03:53 +01:00
< ul class = "pagination pagination-sm" >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Previous" > < span aria-hidden = "true" > « < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< li > < a href = "#" > 1< / a > < / li >
< li > < a href = "#" > 2< / a > < / li >
< li > < a href = "#" > 3< / a > < / li >
< li > < a href = "#" > 4< / a > < / li >
< li > < a href = "#" > 5< / a > < / li >
2014-12-08 15:54:20 +01:00
< li > < a href = "#" aria-label = "Next" > < span aria-hidden = "true" > » < / span > < / a > < / li >
2014-03-17 03:03:53 +01:00
< / ul >
2014-09-09 05:34:26 +02:00
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." > < ul class = "pagination pagination-lg" > ...< / ul > < / nav >
< nav aria-label = "..." > < ul class = "pagination" > ...< / ul > < / nav >
< nav aria-label = "..." > < ul class = "pagination pagination-sm" > ...< / ul > < / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
< h2 id = "pagination-pager" > Pager< / h2 >
< 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 >
< h3 > Default example< / h3 >
< p > By default, the pager centers links.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "simple-pager" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
< li > < a href = "#" > Previous< / a > < / li >
< li > < a href = "#" > Next< / a > < / li >
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
< li > < a href = "#" > Previous< / a > < / li >
< li > < a href = "#" > Next< / a > < / li >
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
< h3 > Aligned links< / h3 >
< p > Alternatively, you can align each link to the sides:< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "aligned-pager-links" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
2014-10-30 17:45:33 +01:00
< li class = "previous" > < a href = "#" > < span aria-hidden = "true" > ← < / span > Older< / a > < / li >
< li class = "next" > < a href = "#" > Newer < span aria-hidden = "true" > → < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
2014-10-30 17:45:33 +01:00
< li class = "previous" > < a href = "#" > < span aria-hidden = "true" > ← < / span > Older< / a > < / li >
< li class = "next" > < a href = "#" > Newer < span aria-hidden = "true" > → < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
< h3 > Optional disabled state< / h3 >
< p > Pager links also use the general < code > .disabled< / code > utility class from the pagination.< / p >
2014-11-25 02:09:32 +01:00
< div class = "bs-example" data-example-id = "disabled-pager" >
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
2014-10-30 17:45:33 +01:00
< li class = "previous disabled" > < a href = "#" > < span aria-hidden = "true" > ← < / span > Older< / a > < / li >
< li class = "next" > < a href = "#" > Newer < span aria-hidden = "true" > → < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
< / div >
{% highlight html %}
2016-04-10 15:54:05 +02:00
< nav aria-label = "..." >
2014-09-09 05:34:26 +02:00
< ul class = "pager" >
2014-10-30 17:45:33 +01:00
< li class = "previous disabled" > < a href = "#" > < span aria-hidden = "true" > ← < / span > Older< / a > < / li >
< li class = "next" > < a href = "#" > Newer < span aria-hidden = "true" > → < / span > < / a > < / li >
2014-09-09 05:34:26 +02:00
< / ul >
< / nav >
2014-03-17 03:03:53 +01:00
{% endhighlight %}
< / div >