Pagination
Numbers, as far as the eye can see
Includes a Ruby component and corresponding Rails helper
RubyExample
<%= nk_pagination do |p| %>
<%= p.prev %>
<%= p.page(1) %>
<%= p.ellipsis %>
<%= p.page(42) %>
<%= p.next %>
<% end %>Pagy Docs
Nitro Kit comes with built-in support for the gem Pagy. That's a freebie!
nk_pagy_nav has the same API as pagy_nav.
<%= nk_pagy_nav(pagy) %>Usage
| ||
|---|---|---|
| Property | Default | Description |
**attrs | HTML attributes for <nav> element | |
| ||
|---|---|---|
| Property | Default | Description |
text | Previous | Plain text content |
**attrs | HTML attributes for <a> element | |
| ||
|---|---|---|
| Property | Default | Description |
text | Next | Plain text content |
**attrs | HTML attributes for <a> element | |
| ||
|---|---|---|
| Property | Default | Description |
text | nil | Plain text content |
current | false | Whether the page is the current page. |
**attrs | HTML attributes for <a> element | |
| ||
|---|---|---|
| Property | Default | Description |
**attrs | HTML attributes for <button> element | |
| ||
|---|---|---|
| Property | Default | Description |
pagy | A Pagy instance. | |
**attrs | HTML attributes for <nav> element | |