Basic Concepts
How To
Migrate WillPaginate/Kaminari
API
Pagy
Pagy::Backend
Pagy::Frontend
Pagy::Countless
Javascript
Extras
Arel
Array
Bootstrap
Bulma
Countless
Elasticsearch Rails
Foundation
Headers
I18n
Items
Overflow
Materialize
Metadata
Navs
Searchkick
Semantic
Support
Tailwind
Trim
UIkit
➡ Chat Support on Gitter ➡
Pagy comes with a few optional extensions/extras:
Extra | Description | Links |
---|---|---|
arel |
Better performance of grouped ActiveRecord collections | arel.rb, documentation |
array |
Paginate arrays efficiently avoiding expensive array-wrapping and without overriding | array.rb, documentation |
bootstrap |
Add nav, nav_js and combo_nav_js helpers for the Bootstrap pagination component | bootstrap.rb, documentation |
bulma |
Add nav, nav_js and combo_nav_js helpers for the Bulma pagination component | bulma.rb, documentation |
countless |
Paginate without any count, saving one query per rendering | countless.rb, documentation |
elasticsearch_rails |
Paginate elasticsearch_rails gem results efficiently |
elasticsearch_rails.rb, documentation |
foundation |
Add nav, nav_js and combo_nav_js helpers for the Foundation pagination component | foundation.rb, documentation |
headers |
Add RFC-8288 compliant http response headers (and other helpers) useful for API pagination | headers.rb, documentation |
i18n |
Use the I18n gem instead of the pagy implementation |
i18n.rb, documentation |
items |
Allow the client to request a custom number of items per page with a ready to use selector UI | items.rb, documentation |
materialize |
Add nav, nav_js and combo_nav_js helpers for the Materialize CSS pagination component | materialize.rb, documentation |
metadata |
Provides the pagination metadata to Javascript frameworks like Vue.js, react.js, etc. | metadata.rb, documentation |
navs |
Add nav_js and combo_nav_js javascript unstyled helpers | navs.rb, documentation |
overflow |
Allow for easy handling of overflowing pages | overflow.rb, documentation |
searchkick |
Paginate Searchkick::Results objects efficiently |
searchkick.rb, documentation |
semantic |
Add nav, nav_js and combo_nav_js helpers for the Semantic UI CSS pagination component | semantic.rb, documentation |
support |
Extra support for features like: incremental, infinite, auto-scroll pagination | support.rb, documentation |
trim |
Remove the page=1 param from links |
trim.rb, documentation |
tailwind |
Extra styles for Tailwind CSS | documentation |
uikit |
Add nav, nav_js and combo_nav_js helpers for the UIkit pagination component | uikit.rb, documentation |
Extras are not loaded by default, so you should require them explicitly in your pagy.rb
initializer (see Configuration):
require 'pagy/extras/bootstrap'
require 'pagy/extras/...'
Extras don’t define any new module or class, they just re-open the Pagy
class and modules, adding the extra methods as they were part of the loaded pagy
gem. This neatly separates the core code from the optional extras, still keeping its usage as simple as it were part of the core.
A few extras require the pagy/extras/shared file. It defines only a few methods used internally, so you don’t actually need to use them directly.
Notice: All the other added methods are documented in the respective extras doc.
A few helpers use javascript, and they are clearly recognizable by the js
suffix:
pagy*_nav_js
pagy*_combo_nav_js
pagy_items_selector_js
See Javascript