# pagination-with-react

> React Pagination

Latest version **1.0.1** (published 2018-07-01) · 0 weekly downloads

## Install

```sh
npm install pagination-with-react
pnpm add pagination-with-react
yarn add pagination-with-react
bun add pagination-with-react
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-07-01 |
| First published | 2018-05-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | dvv.avinash |

## Links

- npm: https://www.npmjs.com/package/pagination-with-react
- Repository: https://github.com/avinashdvv/react-pagination
- Homepage: https://github.com/avinashdvv/react-pagination#readme
- Issues: https://github.com/avinashdvv/react-pagination/issues
- npm.io page: https://npm.io/package/pagination-with-react

## Dependencies (7)

- [react](https://npm.io/package/react.md) ^16.4.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.4.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [lodash.round](https://npm.io/package/lodash.round.md) ^4.0.4
- [lodash.times](https://npm.io/package/lodash.times.md) ^4.3.2
- [react-scripts](https://npm.io/package/react-scripts.md) 1.1.4
- [pagination-with-react](https://npm.io/package/pagination-with-react.md) ^0.1.1

## Recent versions

- 1.0.1 (latest) — 2018-07-01
- 0.1.2 — 2018-05-30
- 0.1.1 — 2018-05-30
- 0.1.0 — 2018-05-30

## README

# Project Title

React Pagination

### Documentation
Props

 Prop | Type
---------|---------
currentActiveIndex | Number
children | children app
numberOfPagesPerScreen| Number, How many pages numbers should user see per screen?
totalNumberOfPages | Number, Total number of pages
onPageButtonClick| Function, callback function for onClick pagination button to get the current page number
prefix | String or React Component, if you want to add anything before pagination buttons
suffix| String or React Component, if you want to add anything after pagination buttons
icons | Object with keys `left, leftMost, right, rightMost `  if you want to change the icons of a arrow

```
Icons Default Values
icons: {
  left: <span>&larr;</span>,
  leftMost: <span>&#8647;</span>,
  right: <span>&rarr;</span>,
  rightMost: <span>&#8649;</span>,
}
```


### Installing

npm install pagination-with-react

```
import React from 'react';
import ReactDOM from 'react-dom';
import { ReactPagination  } from 'pagination-with-react';

class App extends React.Component{
  constructor(){
    super()
    this.state={
      id: 1,
    }
  }
  render() {
    return (
      <ReactPagination
        totalNumberOfPages={50}
        numberOfPagesPerScreen={10}
        onPageButtonClick={(id) => {
          this.setState({
            id,
          })
          console.log(this.state)
        }}
        currentActiveIndex={this.state.id}
      >
        <h1>Children {this.state.id}</h1>
      </ReactPagination>
    )
  }
}

```

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