# tvt-pagination

> React Native Pagination

Latest version **1.1.0** (published 2020-08-25) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-08-25 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tran Van Tuan |
| Maintainers | tuantvk |
| Keywords | react-native, react-native-pagination, tvt-pagination, pagination |

## Links

- npm: https://www.npmjs.com/package/tvt-pagination
- Repository: https://github.com/tuantvk/tvt-pagination
- Homepage: https://github.com/tuantvk/tvt-pagination.git
- Issues: https://github.com/tuantvk/tvt-pagination/issues
- npm.io page: https://npm.io/package/tvt-pagination

## Recent versions

- 1.1.0 (latest) — 2020-08-25
- 1.0.0 — 2020-08-24

## README

# tvt-pagination

A long list can be divided into several pages using `Pagination`, and only one page will be loaded at a time.


### Getting started

```sh
yarn add tvt-pagination
```

![screen_shot](./assets/screen_shot.png)


### Example

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

export default () => (
  <Pagination
    defaultCurrent={1}
    total={50}
  />
);
```

```js
import React from 'react';
import { Text } from 'react-native';
import Pagination from 'tvt-pagination';

export default () => (
  <Pagination
    size="small"
    total={50}
    prevIcon={
      <Text>Prev</Text>
    }
    nextIcon={
      <Text>Next</Text>
    }
  />
);
```

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

export default () => (
  <Pagination
    total={50}
    defaultCurrent={1}
    defaultPageSize={5}
    onChange={(page, pageSize) => alert(`${page} ${pageSize}`)}
  />
);
```


### API

| Property          | Description | Type | Default |
| -----------       | ----------- | ----------- | ----------- |
| defaultCurrent    | Default initial page number | number | 1 |
| defaultPageSize   | Default number of data items per page | number | 10 |
| disabled          | Disable pagination | boolean | |
| total             | Total number of data items | number | 0 |
| onChange          | Called when the page number is changed, and it takes the resulting page number and pageSize as its arguments | function(page, pageSize) | |
| size              | Specify the size of `Pagination`, can be set to `small` | default | middle | small |
| borderColor       | Border color button pagination | string | #d9d9d9 |
| borderColorActive | Border color button current pagination | string | #1890ff |
| activeOpacity     | Determines what the opacity of the wrapped view should be when touch is active | number | 1 |
| prevIcon          | Set the icon prev | ReactNode | |
| nextIcon          | Set the icon next | ReactNode | |
| styleBox          | Style for box button | [ViewStyleProps](https://reactnative.dev/docs/view-style-props#docsNav) | |
| style             | Style for `Pagination` | [ViewStyleProps](https://reactnative.dev/docs/view-style-props#docsNav) | |
| testID            | Used to locate this view in end-to-end tests | string | |

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