Pagination limitation?

Hi there,

I was wondering if there was any way in the api to limit the amount of pages ahead that are displayed on my pagination on the page, so for example i could limit it to 5? The reason for this is my pagination currently goes outside of it’s container on smaller devices so it needs to display less content to fit in.

I found this https://www.algolia.com/doc/api-reference/api-parameters/paginationLimitedTo/ but I beleive that is just a limit on how high you can go as opposed to how many are displayed on the page at a time.

Thanks!

Found the answer here: https://community.algolia.com/instantsearch.js/v2/widgets/pagination.html

use maxPages: as a parameter.

1 Like

You can also use pagesPadding to only show the next and previous X pages, but still allow people to look at later pages

Cool! thanks for the tip will check it out! :slight_smile:

1 Like