ResultsPerPage
ResultsPerPage renders a list of the possible number of results per page.
The component is not displayed while executing the search query or if there are no results.
Usage
<ResultsPerPage
values={[{text: "Ten", value: 10}, {text: "Twenty", value: 20}]}
/>
Props
-
values
ArrayA list of possible values, where each value has the format
{ text: "Fifty", value: 50 }.
-
label
functionoptionalAn optional function to wrap the component with a prefix and suffix string.
E.g.label={(cmp) => <> Show {cmp} results per page</>}
-
overridableId
StringoptionalAn optional string to define a specific overridable id.
Usage when overriding
const MyResultsPerPage = ({ currentSize, options, onValueChange, ariaLabel, selectOnNavigation }) => {
...
}
const overriddenComponents = {
"ResultsPerPage.element": MyResultsPerPage
};
Parameters
-
currentSize
StringThe current value of the
sizequerystate. -
options
ArrayThe options passed as prop to the component.
-
onValueChange
GunctionThe function to call when the user changes the number of results per page to change the
querystate.onValueChange(newValue) -
ariaLabel
StringThe ARIA (Accessibility) label to add to the component.
-
selectOnNavigation
BooleanWhen using a dropdown, set if the
onValueChangeshould be called when the new dropdown item is selected with arrow keys, or only on click or on enter. -
showWhenOnlyOnePage
BooleanAllows to configure whether or not the component will render when there is only one page of results available. Default value:
true.