bulma/docs/documentation/components/pagination.html

171 lines
4.4 KiB
HTML
Raw Normal View History

---
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>
2016-10-30 22:31:54 +00:00
<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>
2016-10-30 22:31:54 +00:00
{% 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">&hellip;</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">&hellip;</span>
</li>
<li>
<a class="pagination-link">86</a>
</li>
</ul>
</nav>
{% endcapture %}
<div class="example">
{{pagination_example}}
</div>
{% highlight html %}
2016-10-30 22:31:54 +00:00
{{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">
2016-10-30 22:31:54 +00:00
<a class="pagination-previous is-disabled">Previous</a>
<a class="pagination-next">Next page</a>
<ul class="pagination-list">
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link is-current">1</a>
</li>
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link">2</a>
</li>
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link">3</a>
</li>
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link">4</a>
</li>
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link">5</a>
</li>
<li>
2016-10-30 22:31:54 +00:00
<span class="pagination-ellipsis">&hellip;</span>
</li>
<li>
2016-10-30 22:31:54 +00:00
<a class="pagination-link">86</a>
</li>
</ul>
</nav>
2016-10-30 22:31:54 +00:00
{% 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">&hellip;</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">&hellip;</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 %}
2016-10-30 22:31:54 +00:00
{% 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">&hellip;</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">&hellip;</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 %}
</div>
</section>