rc-simple-pagination
v0.1.2
Published
React component for paginating
Downloads
36
Readme
rc-simple-pagination
Demo: https://vladop.github.io/rc-simple-pagination/examples/index.html
Get started by npm i rc-simple-pagination
Javascript:
const Pagination=require('rc-simple-pagination');
or:
import Pagination from 'rc-simple-pagination'
CSS
For default styling pull css from dist folder:
<link rel="stylesheet" type="text/css" href="node_modules/rc-simple-pagination/dist/pagination.css">
You can use it like this:
render(){
<Pagination activePage={this.state.currentPage} numOfPages={30} onPaginationNumberClicked={this.onNumberClicked} nextLinkTitle={"Next"} prevLinkTitle={"Prev"} />
}
Props
| Name | Type | Default | Description | Optional | ------------- |:--------------:| ----------------:| ------------------------------------------:| ---------:| | activePage | number | no-default| Current active page (state on parent component) | No | | numOfPages | number | no-default| Total number of pages| No | | onPaginationNumberClicked | Function({ newPage,eventName }) | | Callback executed whenever times change | No | | nextLinkTitle | string | Next | Localized text for next button | No | | prevLinkTitle | string | Prev | Localized text for prev button | No |