© 2017-2021 Domizio DemichelisMIT License

➡ 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
meilisearch Paginate Meilisearch results efficiently meilisearch.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
standalone Use pagy without any request object, nor Rack environment/gem, nor any defined params method, even in the irb/rails console without any app or config. standalone.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.

Javascript Helpers

A few helpers use javascript, and they are clearly recognizable by the js suffix:

See Javascript