nikolenkoanton92 / react-easy-paginate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React-Easy-Paginate

React component to render a pagination.

Installation

The easises way to use React-Easy-Paginate is ti install from npm.

npm install react-easy-paginate --save

At this point you can import react-easy-paginate and simple styles in your application :

import ReactEasyPaginate from 'react-easy-paginate'

import `react-easy-paginate/dist/react-easy-paginate.css`

Props

Name Type Default Props Description
pageTotal Number undefined Required. The total number of pages
rangeDisplayed Number undefined Required. The range of page displayed
startPage Number 1 From which page starts
onClick Function undefined The method to call when click on next/previous page, return number of current page
nextLabel node <a>Next</a> Label for the next button
previousLabel node <a>Previous</a> Label for the previous button
activeClass String active The className for the active page
labelDisabledClass String disabled The className for the disabled label

Example

To run example locally, clone this repo then run:

//if you do not install the module, if installed, proceed to the next step

npm install

make run-example

After open localhost:8000 (or what port you using in process.env.PORT) in a browser.

License

MIT Licensed.

About

License:MIT License


Languages

Language:JavaScript 93.9%Language:CSS 3.0%Language:Makefile 1.9%Language:HTML 1.1%