resultsPerPageRanges
A prop used in pagination components to provide users with options for selecting the number of results displayed per page.
defaultActivePage
This prop controls the default active page that is shown when the component mounts.
activePage
Prop used when taking a controlled approach of the active page. Normally handled by a state,
defaultActiveRange
Used to pass a default active range. Note that, it should be a value contained in the resultsPerPageRanges
array.
activeRange
Used to pass a controlled active range. Note that, it should be a value contained in the resultsPerPageRanges
array.
resultsTotal
The amount of total results, most of the cases this will be equal to the array length of your API response/ JSON.
disableMovingForward
By default, when there are no more pages available, this is set to true, but you can control it anyways.
onPageChange, onRangeChange, onMoveForward, onMoveBackward
onPageChange: Handles page selection, updating component state or triggering data retrieval for the chosen page.
onRangeChange: Manages the change in displayed results per page, updating component state or adjusting displayed results.
onMoveForward: Executes when the user moves to the next page, updating pagination state and potentially fetching data for the subsequent page.
onMoveBackward: Triggers when the user moves to the previous page, updating pagination state and potentially fetching data for the previous page.
All of them receive the current page as an argument, except the onRangeChange
function, that receives the current range.
customText
An object passed to customize each passed text.
resultsPerPageRanges: Customizes text before a dropdown menu showing result display options. EG: 'Ranges: '
of: Allows customization of the text between current and total page numbers: EG: 'of'
results: Customizes text indicating the total number of search results. EG: 'results found'