0.0.7 • Published 5 years ago

react-studio-paginator v0.0.7

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

react-studio-paginator

A react paginator component that displays a list of items in a numbered page


Props


NameTypeDescriptions
customElement(index:number)=> React.ReactNodeThis is a method that will be called to retrieve a single item of the paginator.
elementsPerView?numberThe number of elements to be shown in one page
totalElementsnumberTotal number of elements to be shown in different pages
defaultPageIdx?numberThis can be set if you need to start the page from a different index
showPaginatorControls?booleanTrue if it should show the controls and the page numbers
className?stringParent element class name
previousButton?React.ReactNodeComponent for the previous button
nextButton?React.ReactNodeComponent for the next button
pageStatusComponent?(currentPage:number, totalPages:number) =>React.ReactNodeThis is a function to show the current page status

Default Props


NameDefault
className""
showPaginatorControlstrue
elementsPerView10
previousButton<button>Previous</button>
nextButton<button>Next</button>
pageStatusComponent(e,i)=> `${e} of ${i}`}

Installation

$ npm install --save react-studio-paginator

Usage

import {Paginator} from "react-studio-paginator";

Simple Example

<Paginator 
    totalElements={data.length}
    customElement={(idx)=>{
        let item = data[idx];
        return <div>{item.label}</div>
    }}
/>

Other Links

More details on how to use this component can be found in this article

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago