#
In
#
@pagy.✳ Helpers
The @pagy
instance provides all the helpers to use in your code.
Its class is determined by the paginator used, but you can safely ignore it. Simply utilize its methods.
The @pagy
helpers are autoloaded only if used!
Unused code consumes no memory.
data_hash
headers_hash
urls_hash
page_url
series_nav
series_nav_js
input_nav_js
anchor_tags
info_tag
limit_tag_js
Helpers can inherit and override options
See Options
:pagy/nil
style (default style):bootstrap
- Set
classes: 'pagination pagination-sm any-class'
style option to override the default'pagination'
class.
- Set
:bulma
- Set
classes: 'pagination is-small any-class'
style option to override the default'pagination'
classes.
- Set
id: 'my-nav'
:- Set the
id
HTML attribute of thenav
tag.
- Set the
aria_label: 'My Label'
:- Override the default
pagy.aria_label.nav
string of thearia-label
attribute. (Use an already pluralized string).
Don't rely on ARIA default with multiple nav elements!
The
nav
elements arelandmark roles
, and should be distinctly labeled.Override the default
:aria_label
s for multiple navs with distinct values!<%# Explicitly set the aria_label %> <%== @pagy.series_nav(aria_label: 'Search result pages') %>
Refer to ARIA for additional information.
- Override the default