Skip to content

Darksoulsong/react-native-paginator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-paginator

A simple React Native paginator

Installation

Install it running npm i react-native-paginator on a terminal.

Usage

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={...}
/>

Props

totalItems: number

The total items count.

buttonStyles: Stylesheet

An object literal containing valid Stylesheet rules for the buttons.

buttonActiveStyles: Stylesheet

An object literal containing valid Stylesheet rules for the active buttons.

buttonControlStyles: Stylesheet

An object literal containing valid Stylesheet rules for the control buttons (the forward and backward page buttons).

buttonAltStyles: Stylesheet

An object literal containing valid Stylesheet rules for the alternative buttons (the ones that show the ellipsis indicator).

disabled: boolean

Disables the paginator buttons. Default to false.

showControls?: boolean

Enables/disables the control buttons. Defaults to false.

activePage?: number

Tells the component which page the Paginator should be initialized with. Defaults to 1.

pageRangeDisplayed?: number

The number of page buttons displayed. Defaults to 3.

onChange: (pageNumber: number) => void

Callback for the button click. The page number is available as a parameter.

About

A simple React Native paginator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published