1.0.11 • Published 4 years ago

reactive-pagination v1.0.11

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

reactive-pagination

React Component to provide pagination for your application. It comes with not just a basic layout but also provides some built in custom designs for your application.

NPM JavaScript Style Guide

Installation

npm install reactive-pagination --save

Usage

import React, { Component } from "react";

import Pagination from "reactive-pagination";
import "reactive-pagination/dist/index.css";

class Example extends Component {
  constructor(props) {
    super(props);
    this.state = {
      activePage: 1,
    };
  }

  handlePageChange = (pageNum) => {
    this.setState({
      activePage: pageNum,
    });
  };

  render() {
    const { activePage } = this.state;

    return (
      <Pagination
        activePage={activePage}
        itemsCountPerPage={10}
        totalItemsCount={400}
        delimeter={10}
        onChange={this.handlePageChange}
        styling="default"
      />
    );
  }
}

Params

NameTypeDefaultRequiredDescription
activePageNumber1TrueCurrently Active Page in Pagination
totalItemsCountNumberTrueTotal count of items which you are going to display
onChangeFunctionTruePage change handler function. Receives pageNum as argument.
itemsCountPerPageNumber10FalseTotal items to display in single page
delimeterNumber5FalseNumber of pages in paginator, excluding navigation blocks (prev, next, first, last pages)
stylingStringdefaultFalseDefines different style guides for pagination. Possible params are: default, borderless, primary, rounded, rounded_primary

Examples

Default

react pagination default styling

Borderless

react pagination borderless styling

Primary

react pagination primary styling

Rounded

react pagination rounded styling

Rounded Primary

react pagination rounded primary styling

License

MIT © Free Software, Hell Yeah!

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago