# tn-pagination

> A pagination component for reactjs.

Latest version **1.0.4** (published 2017-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install tn-pagination
pnpm add tn-pagination
yarn add tn-pagination
bun add tn-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.0.4 |
| Published | 2017-08-10 |
| First published | 2017-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Panacholn Pongsamrithphol |
| Maintainers | panacholn |
| Keywords | npm, pagination, react |

## Links

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

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^15.6.1
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.1
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [react-router](https://npm.io/package/react-router.md) ^4.1.2
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^4.1.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-08-10
- 1.0.3 — 2017-08-09
- 1.0.2 — 2017-08-09
- 1.0.1 — 2017-08-09
- 1.0.0 — 2017-08-09

## README

# pagination

[![Coverage Status](https://coveralls.io/repos/github/panacholn/pagination/badge.svg)](https://coveralls.io/github/panacholn/pagination) [![npm version](https://img.shields.io/npm/v/tn-pagination.svg?style=flat)](https://www.npmjs.com/package/tn-pagination)

A SEO friendly pagination component for React.

### Install

Via NPM
```
npm install tn-pagination
```

### Usage

```js
import React from 'react';
import Pagination from 'tn-pagination';

class MyComponent extends React.Component {
  componentDidMount() {
    // fetch data for the first time render.
  }

  componentWillReceiveProps(nextProps) {
    // fetch data when click the pagination.
  }

  genUrl = (page) => `/page/${page}`;

  render() {
    return (
      <div>
        <h1>Item list</h1>
        ... //list of items
        <Pagination
          pageCount={15}
          pageRangeDisplayed={5}
          page={1}
          genUrl={this.genUrl}
        />
      </div>
    );
  }
}
```
### Props

List of props that can pass into the components.

| Props | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| pageCount | Integer | true | - | Number of total Pages |
| pageRangeDisplayed | Integer | true | - | Range that pagination display |
| genUrl | Function | true | - | Function for generate url to attach in the pagination link |
| page | Integer | false | 1 | Number of current page |
| firstLabel | String | false | '\xAB' | Label for the first page button |
| previousLabel | String | false | '\u2039' | Label for the previous page button |
| nextLabel | String | false | '\u203A' | Label for the next page button |
| lastLabel | String | false | '\xBB' | Label for the last page button |
| containerClassName | String | false | 'pagination' | Classname of the pagination component |
| activeClassName | String | false | 'active' | Classname of the current page button |
| pageClassName | String | false | 'page' | Classname of the button excluded first/previous/next/last button |
| pageLinkClassName | String | false | 'page-link' | Classname of the link in the button excluded first/previous/next/last button |
| firstClassName | String | false | 'first' | Classname of the first button |
| firstLinkClassName | String | false | 'first-link' | Classname of the link in the first button |
| previousClassName | String | false | 'previous' | Classname of the previous button |
| previousLinkClassName | String | false | 'previous-link' | Classname of the link in the previous button |
| nextClassName | String | false | 'next' | Classname of the next button |
| nextLinkClassName | String | false | 'next-link' | Classname of the link in the next button |
| lastClassName | String | false | 'last' | Classname of the last button |
| lastLinkClassName | String | false | 'last-link' | Classname of the link in the last button |

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