#
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.
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 also Options
anchor_string: 'data-turbo-frame="paginate"'- Concatenate a verbatim raw string to the internal HTML of the anchor tags. It must contain properly formatted HTML attributes. It's not suitable for
*_hashhelpers.
- Concatenate a verbatim raw string to the internal HTML of the anchor tags. It must contain properly formatted HTML attributes. It's not suitable for
:pagy/nilstyle (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
idHTML attribute of thenavtag.
- Set the
aria_label: 'My Label':- Override the default
pagy.aria_label.navstring of thearia-labelattribute. (Use an already pluralized string).
Don't rely on ARIA default with multiple nav elements!
The
navelements arelandmark roles, and should be distinctly labeled.Override the default
:aria_labels 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