# reaco-pagination

> A ReactJS component that creates a pagination.

Latest version **1.1.0** (published 2020-04-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install reaco-pagination
pnpm add reaco-pagination
yarn add reaco-pagination
bun add reaco-pagination
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-04-06 |
| First published | 2017-10-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 57 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rahul Bansal |
| Maintainers | rahulbansal-ofb |
| Keywords | react-component, paginate, paginator, pagination |

## Links

- npm: https://www.npmjs.com/package/reaco-pagination
- Repository: https://github.com/ofbusiness/reaco/tree/master/src/components/pagination
- npm.io page: https://npm.io/package/reaco-pagination

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [react-paginate](https://npm.io/package/react-paginate.md) ^4.4.4

## Recent versions

- 1.1.0 (latest) — 2020-04-06
- 1.0.9 — 2018-11-06
- 1.0.8 — 2017-10-11
- 1.0.7 — 2017-10-10
- 1.0.6 — 2017-10-10
- 1.0.5 — 2017-10-10
- 1.0.4 — 2017-10-10
- 1.0.3 — 2017-10-10
- 1.0.2 — 2017-10-10
- 1.0.1 — 2017-10-05

## README

# REACO-PAGINATION

A ReactJS component that creates a pagination.

Reaco-Pagination is written over [AdeleD/react-paginate](https://github.com/AdeleD/react-paginate).

## Installation

Using npm:
```shell
$ npm install --save reaco-pagination
```

### Code example

```javascript
import React, { Component } from 'react';
import Pagination from 'reaco-pagination';

// finally the component to be render
<Pagination
      forcePage={0}
      total={150} 
      size={10} 
      dataSize={10}
      handlePageChange={this.onPageChange}
      handlePageOptionChange={this.onPageOptionChange} />
```

See the [App.js](https://github.com/ofbusiness/reaco/blob/master/src/App.js) for complete code example.

## Props
| Name                                       | Type        | Description  
| ---                                        | ---         | ---                                        
| `total`                                    | `Number`    | **Required.** The total number of data across the pages.
| `size`                                     | `Number`    | **Required.** The total number of maximum data per page i.e per page count.
| `dataSize`                                 | `Number`    | **Required.** The least number of rows per page i.e there may be less items on last page in compare to maximum count per page.
| `forcePage`                                | `Number`    | **Optional.** This is current page index.
| `handlePageChange`                         | `Function`  | **Optional.** This is the callback function hits on page number's click.
| `handlePageOptionChange`                   | `Function`  | **Optional.** This is the callback function hits on page count option's click.
| `pageOptions`                              | `Array`     | **Optional.** This is list of different page counts. ex: [10, 25, 50, 100]
| `pageSummaryText`                          | `String`    | **Optional.** This is text string of pagination summary. It must contain these words i.e '#first_count#, #last_count#, #total_counts#' to show 'inital count of page, last count of page and total counts of all pages' respectively. ex: 'Showing <strong>#first_count# to #last_count#</strong> of #total_counts# entries'

See the full Documentation of **react-paginate** [here](https://github.com/AdeleD/react-paginate).

---
_Source: https://npm.io/package/reaco-pagination · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
