# jubby2000-pager

> >

Latest version **1.0.2** (published 2019-09-07) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2019-09-07 |
| First published | 2019-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 64.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jubby2000 |
| Maintainers | jubby2000 |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2019-09-07
- 1.0.1 — 2019-09-07

## README

# pager

> 

[![NPM](https://img.shields.io/npm/v/pager.svg)](https://www.npmjs.com/package/pager) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save jubby2000-pager
```

## Usage

```tsx
import * as React from 'react'

import Pager from 'jubby2000-pager'

class Example extends React.Component {
  render () {
    return (
      <div>
        <h1>Employees</h1>
        <Pager
          pages={employees.map(employee => (
            <ul key={employee.id}>
              <li>Name: {employee.last_name}, {employee.first_name}</li>
              <li>Department: {employee.department}</li>
              <li>Salary: ${employee.salary}</li>
            </ul>
          ))}
          getLabel={
            i => `${employees[i].last_name}, ${employees[i].first_name}`
          }
          pageInfoUrl={(label) => `https://www.example.com/employees/info?label=${label}`}
          supportRequestUrl="https://www.example.com/support"
        >
          {({
            page,
            goPrevious,
            goNext,
            goToLabel,
            currentPageLabel,
            pageLabels,
            showHelpScreen,
            pageInfoIsLoading,
            pageInfoError,
            pageInfo,
          })=>(
            <div>
              <div>
                <select onChange={e => goToLabel(e.target.value)}>
                  {pageLabels.map(label => (
                    <option
                      key={label}
                      value={label}
                      selected={label === currentPageLabel}
                    >
                      {label}
                    </option>
                  ))}
                </select>
                <button onClick={goPrevious}>Previous</button>
                <button onClick={goNext}>Next</button>
                <button onClick={showHelpScreen}>Help</button>
              </div>
              <div>
                {page}
              </div>
              {pageInfoIsLoading && (
                <div>Loading more info...</div>
              )}
              {pageInfoError && (
                <div>Error fetching info: {pageInfoError}</div>
              )}
              {pageInfo && (
                <div>
                  # of Likes: {pageInfo.likes}
                </div>
              )}
            </div>
          )}
        </Pager>
      </div>
    );
  }
}
```

## License

MIT © [jubby2000](https://github.com/jubby2000)

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