# the-pager

> Pager of the-components

Latest version **2.0.14** (published 2019-02-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install the-pager
pnpm add the-pager
yarn add the-pager
bun add the-pager
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.14 |
| Published | 2019-02-26 |
| First published | 2017-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 6 |
| Unpacked size | 80.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Taka Okunishi |
| Maintainers | okunishinishi |
| Keywords | react-component, the |

## Links

- npm: https://www.npmjs.com/package/the-pager
- Repository: https://github.com/the-labo/the-pager
- Homepage: https://github.com/the-labo/the-pager#readme
- Issues: https://github.com/the-labo/the-pager/issues
- npm.io page: https://npm.io/package/the-pager

## Dependencies (6)

- [numcal](https://npm.io/package/numcal.md) ^4.0.0
- [the-style](https://npm.io/package/the-style.md) ^2.2.8
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [clay-list-pager](https://npm.io/package/clay-list-pager.md) ^3.0.1
- [the-component-util](https://npm.io/package/the-component-util.md) ^3.0.22

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 2.0.14 (latest) — 2019-02-26
- 2.0.13 — 2018-11-15
- 2.0.12 — 2018-11-11
- 2.0.11 — 2018-08-14
- 2.0.10 — 2018-08-14
- 2.0.9 — 2018-08-12
- 2.0.8 — 2018-08-12
- 2.0.7 — 2018-08-03
- 2.0.6 — 2018-06-18
- 2.0.5 — 2018-06-18
- 2.0.4 — 2018-06-18
- 2.0.3 — 2018-06-16
- 2.0.2 — 2018-01-12
- 2.0.1 — 2018-01-12
- 2.0.0 — 2017-09-29
- … 8 more at https://npm.io/package/the-pager/versions

## README

the-pager
==========

<!---
This file is generated by the-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/the-labo/the-pager
[bd_travis_url]: http://travis-ci.org/the-labo/the-pager
[bd_travis_shield_url]: http://img.shields.io/travis/the-labo/the-pager.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/the-labo/the-pager
[bd_travis_com_shield_url]: https://api.travis-ci.com/the-labo/the-pager.svg?token=
[bd_license_url]: https://github.com/the-labo/the-pager/blob/master/LICENSE
[bd_npm_url]: http://www.npmjs.org/package/the-pager
[bd_npm_shield_url]: http://img.shields.io/npm/v/the-pager.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Pager of the-components

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install the-pager --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

[Live Demo](https://the-labo.github.io/the-pager/doc/demo/index.html#/) is hosted on GitHub Page

```javascript
'use strict'

import React from 'react'
import { ThePager, ThePagerStyle } from 'the-pager'

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    const s = this
    s.state = {page: 2}
  }

  render () {
    const s = this
    let {state} = s
    return (
      <div>
        <ThePagerStyle/>
        <ThePager.Row>
          <ThePager total={8}
                    page={state.page}
                    size={3}
                    onChange={(e) => s.setState({page: e.page})}>
          </ThePager>
          <ThePager.Counts counts={{limit: 25, offset: 25, total: 52}}/>
        </ThePager.Row>

        <hr/>

        <ThePager total={15}
                  page={state.page}
                  size={5}
                  hrefPattern='?page=:page'>
        </ThePager>
      </div>

    )
  }
}

export default ExampleComponent

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.Components.md.hbs" Start -->

<a name="section-doc-guides-03-components-md"></a>

Components
-----------

### ThePager

Pager of the-components

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `hrefPattern` | string  | Pattern for href | `null` |
| `onChange` | func  | Handler for page change | `` |
| `page` | number  | Current page number. Start with 0 | `` |
| `size` | number  | Number of items to show | `5` |
| `total` | number  | Total page count | `` |

### ThePagerStyle

Style for ThePager

**Props**

| Name | Type | Description | Default |
| --- | --- | ---- | ---- |
| `options` | object  | Style options | `{}` |



<!-- Section from "doc/guides/03.Components.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/the-labo/the-pager/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [THE Labo][the_labo_url]

[the_labo_url]: https://github.com/the-labo

<!-- Links End -->

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