Pagination
Pagination renders the controls for navigating the search result pages.
The component is not displayed while executing the search query, if the current page or results per page are not set or if there are no results.
Usage
const options = { showEllipsis: false, showLastIcon: false }
<Pagination options={options} />
Props
options
objectoptionalAn object that can contain:
- boundaryRangeCount
Number: Number of always visible pages at the beginning and end. Default value:1. - siblingRangeCount
Number: Number of always visible pages before and after the current one. Default value:1. - showEllipsis
Boolean: Show '...' for hidden pages. Default value:true. - showFirst
Boolean: Show the icon to go to the first page. Default value:true. - showLast
Boolean: Show the icon to go to the last page. Default value:true. - showPrev
Boolean: Show the icon to go to the previous page. Default value:true. - showNext
Boolean: Show the icon to go to the next page. Default value:true. - size
String: Component size, one of["mini", "tiny", "small", "large", "huge", "massive"].
- boundaryRangeCount
overridableId
StringoptionalAn optional string to define a specific overridable id.
Usage when overriding
const MyPagination = ({ currentPage, currentSize, totalResults, onPageChange, options }) => {
...
}
const overriddenComponents = {
"Pagination.element": MyPagination
};
Parameters
currentPage
NumberThe current value of the
pagequerystate.currentSize
NumberThe current value of the
sizequerystate, to be able to calculate the total number of pages.totalResults
NumberThe current value of the
totalresultsstate representing the number of results, to be able to calculate the total number of pages.onPageChange
NumberFunction to call when the user wants to change the page to change the
querystate.onPageChange(newValue)options
objectThe options prop passed to the component.
showWhenOnlyOnePage
BooleanAllows to configure whether or not the component will render when there is only one page of results available. Default value:
true.