A simple React Native paginator
Install it running npm i react-native-paginator
on a terminal.
Import it to your project:
import Paginator from 'react-native-paginator';
<Paginator
totalItems={itemCount}
onChange={newPage => fetchMoreItemsFn(newPage))}
activePage="1"
disabled={isLoading}
itemsPerPage="48"
buttonStyles={...}
buttonActiveStyles={...}
/>
The total items count.
An object literal containing valid Stylesheet rules for the buttons.
An object literal containing valid Stylesheet rules for the active buttons.
An object literal containing valid Stylesheet rules for the control buttons (the forward and backward page buttons).
An object literal containing valid Stylesheet rules for the alternative buttons (the ones that show the ellipsis indicator).
Disables the paginator buttons. Default to false
.
Enables/disables the control buttons. Defaults to false
.
Tells the component which page the Paginator should be initialized with. Defaults to 1
.
The number of page buttons displayed. Defaults to 3
.
Callback for the button click. The page number is available as a parameter.