npm.io
1.1.6 • Published 8 years ago

pagination-react

Licence
MIT
Version
1.1.6
Deps
0
Vulns
0
Weekly
0

pagination for react

!(preview)[preview.gif]

install

npm install --save-dev pagination-react style-loader css-loader

webpack.config.js

// add loader
{
	test: /\.css$/,
	loader: "style-loader!css-loader"
}

import

import Pagination from 'pagination-react'

use

<Pagination 
	count={16}
	groupCount={5}
	selectedCount={1}
	setUpdate={handle => this.updatePagination = handle}
	callback={index => console.log(index)}/>

count: size

groupCount: every group show how many items

selectedCount: current index, is optional

setUpdate: update index, is optional

callback: an arg with index

Keywords