Links

Page links are generated by setting page parameter to the desired page number. By default, the component will generate links using the current request URL and appending a query parameter named page with the corresponding page number.

If you want to add additional query parameters to all generated links, you can set the url_params parameter to a dictionary containing the desired key-value pairs. Alternatively, you can provide a custom URL generator function by setting the url_generator parameter to a callable that takes a page number and arbitrary keyword arguments and returns a URL string. This allows you to have full control over the URL generation logic, enabling you to create links that fit your application's routing structure or include specific parameters as needed.

{%- call ui.util.call(show_example) -%} {%- raw %} {{ ui.pagination(page=5, total=10, url_params={"extra": "value"}) }} {%- macro url_generator(page) -%} {{ request.url }}?p={{page}}&{{ kwargs.items()|map("join", "=")|join("&") }} {%- endmacro %} {{ ui.pagination(page=5, total=10, url_generator=url_generator) }} {%- endraw %} {%- endcall %}