mirror of
https://github.com/jgthms/bulma.git
synced 2024-12-12 13:28:30 +00:00
227 lines
6.5 KiB
HTML
227 lines
6.5 KiB
HTML
---
|
|
layout: documentation
|
|
doc-tab: components
|
|
doc-subtab: pagination
|
|
---
|
|
|
|
{% include subnav-components.html %}
|
|
|
|
<section class="section">
|
|
<div class="container">
|
|
<h1 class="title">Pagination</h1>
|
|
<h2 class="subtitle">A responsive, usable, and flexible <strong>pagination</strong></h2>
|
|
|
|
<hr>
|
|
|
|
<div class="content">
|
|
<p>
|
|
The pagination component consists of several elements:
|
|
</p>
|
|
<ul>
|
|
<li>
|
|
<code>pagination-previous</code> and <code>pagination-next</code> for incremental navigation
|
|
</li>
|
|
<li>
|
|
<code>pagination-list</code> which displays page items:
|
|
<ul>
|
|
<li>
|
|
<code>pagination-link</code> for the page numbers
|
|
</li>
|
|
<li>
|
|
<code>pagination-ellipsis</code> for range separators
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
All elements are optional so you can compose your pagination as you wish.
|
|
</p>
|
|
</div>
|
|
|
|
{% capture pagination_example %}
|
|
<nav class="pagination">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li>
|
|
<a class="pagination-link">1</a>
|
|
</li>
|
|
<li>
|
|
<span class="pagination-ellipsis">…</span>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link">45</a>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link is-current">46</a>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link">47</a>
|
|
</li>
|
|
<li>
|
|
<span class="pagination-ellipsis">…</span>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link">86</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
<div class="example">
|
|
{{pagination_example}}
|
|
</div>
|
|
{% highlight html %}
|
|
{{pagination_example}}
|
|
{% endhighlight %}
|
|
|
|
<div class="content">
|
|
<p>
|
|
You can disable some links if they are not active, or change the amount of page numbers available.
|
|
</p>
|
|
</div>
|
|
|
|
{% capture pagination_options_example %}
|
|
<nav class="pagination">
|
|
<a class="pagination-previous is-disabled">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li>
|
|
<a class="pagination-link is-current">1</a>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link">2</a>
|
|
</li>
|
|
<li>
|
|
<a class="pagination-link">3</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
<div class="example">
|
|
{{pagination_options_example}}
|
|
</div>
|
|
{% highlight html %}
|
|
{{pagination_options_example}}
|
|
{% endhighlight %}
|
|
|
|
<div class="content">
|
|
<p>
|
|
By default, the list is located on the left, and the previous/next buttons on the right. But you can change the <strong>order</strong> of these elements by using the <code>is-centered</code> and <code>is-right</code> modifiers.
|
|
</p>
|
|
</div>
|
|
|
|
{% capture pagination_centered_example %}
|
|
<nav class="pagination is-centered">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li><a class="pagination-link">1</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">45</a></li>
|
|
<li><a class="pagination-link is-current">46</a></li>
|
|
<li><a class="pagination-link">47</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">86</a></li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
<div class="example">
|
|
{{pagination_centered_example}}
|
|
</div>
|
|
{% highlight html %}
|
|
{{pagination_centered_example}}
|
|
{% endhighlight %}
|
|
|
|
{% capture pagination_right_example %}
|
|
<nav class="pagination is-right">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li><a class="pagination-link">1</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">45</a></li>
|
|
<li><a class="pagination-link is-current">46</a></li>
|
|
<li><a class="pagination-link">47</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">86</a></li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
<div class="example">
|
|
{{pagination_right_example}}
|
|
</div>
|
|
{% highlight html %}
|
|
{{pagination_right_example}}
|
|
{% endhighlight %}
|
|
|
|
<hr>
|
|
|
|
<h2 class="title">Sizes <span class="tag is-success">New!</span></h2>
|
|
<p class="content">
|
|
The pagination comes in <strong>3 additional sizes</strong>.<br>
|
|
You only need to append the <strong>modifier</strong> <code>is-small</code>, <code>is-medium</code>, or <code>is-large</code> to the <code>pagination</code> component.
|
|
</p>
|
|
|
|
{% capture pagination_small_example %}
|
|
<nav class="pagination is-small">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li><a class="pagination-link">1</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">45</a></li>
|
|
<li><a class="pagination-link is-current">46</a></li>
|
|
<li><a class="pagination-link">47</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">86</a></li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
|
|
<div class="example">
|
|
{{pagination_small_example}}
|
|
</div>
|
|
|
|
{% capture pagination_medium_example %}
|
|
<nav class="pagination is-medium">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li><a class="pagination-link">1</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">45</a></li>
|
|
<li><a class="pagination-link is-current">46</a></li>
|
|
<li><a class="pagination-link">47</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">86</a></li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
|
|
<div class="example">
|
|
{{pagination_medium_example}}
|
|
</div>
|
|
|
|
{% capture pagination_large_example %}
|
|
<nav class="pagination is-large">
|
|
<a class="pagination-previous">Previous</a>
|
|
<a class="pagination-next">Next page</a>
|
|
<ul class="pagination-list">
|
|
<li><a class="pagination-link">1</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">45</a></li>
|
|
<li><a class="pagination-link is-current">46</a></li>
|
|
<li><a class="pagination-link">47</a></li>
|
|
<li><span class="pagination-ellipsis">…</span></li>
|
|
<li><a class="pagination-link">86</a></li>
|
|
</ul>
|
|
</nav>
|
|
{% endcapture %}
|
|
|
|
<div class="example">
|
|
{{pagination_large_example}}
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|