0.1.14 • Published 5 years ago

react-pagination-library v0.1.14

Weekly downloads
112
License
MIT
Repository
github
Last release
5 years ago

React-pagination

Simple react pagination library.

Demo

https://isaurssaurav.github.io/react-pagination/

Getting Started

Install dependencies

npm install react-pagination-library or npm install react-pagination-library --save

Uses

import React from "react";
import Pagination from "react-pagination-library";
import "react-pagination-library/build/css/index.css"; //for css

class App extends React.Component {
  state = {
    currentPage: 1
  };
  changeCurrentPage = numPage => {
    this.setState({ currentPage: numPage });
    //fetch a data
    //or update a query to get data
  };
  render() {
    return (
      <div>
        <Pagination
          currentPage={this.state.currentPage}
          totalPages={10}
          changeCurrentPage={this.changeCurrentPage}
          theme="bottom-border"
        />
        <h2>current Page:{this.state.currentPage}</h2>
      </div>
    );
  }
}
export default App;

Params

NameTypeDefaultDescription
totalPagesNumber10Required. Total number of pages which you are going to display
currentPageNumber1Required. Active page number
changeCurrentPageFunctionRequired. Page change handler. Receive current pageNumber as arg
themestringdefaultThemes : default,border-bottom, square-fill, square-i, circle,square

Testing

npm run test or yarn run test

0.1.14

5 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago