Searchstax PaginationWidget for React and Next.js
The SearchStax Site Search solution offers a pagination widget for React and Next.js search pages.
The SearchstaxPaginationWidget
displays pagination controls for search results.
Usage
<SearchstaxPaginationWidget />
Props
paginationTemplate
– Renders custom pagination UI.
paginationTemplate
Customize the pagination UI.
It receives:
paginationData
– Pagination data objectnextPage
– Handles next page clickpreviousPage
– Handles previous page click
Example
<SearchstaxPaginationWidget
paginationTemplate={(paginationData, nextPage, previousPage) => (
<div>
{/* Custom pagination UI */}
<button onClick={previousPage}>Prev</button>
<button onClick={nextPage}>Next</button>
</div>
)}
/>
The paginationData object contains:
totalResults
– Total number of resultsstartResultIndex
– Start index of current pageendResultIndex
– End index of current pageisFirstPage
– Whether on first pageisLastPage
– Whether on last page
Questions?
Do not hesitate to contact the SearchStax Support Desk.