Socket
Socket
Sign inDemoInstall

react-pagination-js

Package Overview
Dependencies
8
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-pagination-js

Simple, light weight pagination for react


Version published
Weekly downloads
231
decreased by-23.51%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-pagination-js

travis build

Simple and light weight pagination for react. This library is updated version of react-pagination-library. It comes with five themes and are easy to customize.

  1. default
  2. dark
  3. bootstrap
  4. border-bottom
  5. circle

Demo

Example

click here for live demo.

Installation

$ npm install react-pagination-js

Usage

import React from "react";
import Pagination from "react-pagination-js";
import "react-pagination-js/dist/styles.css"; // import 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}
        />
        <h2>current Page:{this.state.currentPage}</h2>
      </div>
    );
  }
}
export default App;

Props

NameTypeDefaultDescription
totalSizeNumberRequired. Total data size
sizePerPageNumber10Optional. Number of data to display in page
currentPageNumber1Required. Active page number
changeCurrentPageFunctionRequired. Page change handler. Receive current pageNumber as arg
themestringdefaultOptional. theme : default,dark, bootstrap, border-bottom, circle
showFirstLastPagesbooleantrueOptional. Show or hide first and last page.
firstPageTextstring«Optional. first page text.
lastPageTextstring»Optional. last page text.
nextPageTextstringOptional. next page text.
numberOfPagesNextToActivePageNumber1Optional. Number of page to show next to active page

Keywords

FAQs

Last updated on 27 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc