New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-pagination-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pagination-js

Simple, light weight pagination for react

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 27 Aug 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc