# react-native-page-control

> React native page control, like ios UIPageControl

Latest version **1.1.2** (published 2020-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-page-control
pnpm add react-native-page-control
yarn add react-native-page-control
bun add react-native-page-control
```

## 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.2 |
| Published | 2020-02-17 |
| First published | 2015-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 169 |
| Author | silentcloud |
| Maintainers | silentcloud |
| Keywords | react, react-native, react-component, page-control, PageControl, UIPageControl |

## Links

- npm: https://www.npmjs.com/package/react-native-page-control
- Repository: https://github.com/silentcloud/react-native-page-control
- Issues: https://github.com/silentcloud/react-native-page-control/issues
- npm.io page: https://npm.io/package/react-native-page-control

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [create-react-class](https://npm.io/package/create-react-class.md) ^15.6.0

## 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.1.2 (latest) — 2020-02-17
- 1.1.1 — 2017-11-03
- 1.1.0 — 2017-07-13
- 1.0.7 — 2016-06-16
- 1.0.6 — 2016-03-21
- 1.0.5 — 2015-11-24
- 1.0.4 — 2015-11-24
- 1.0.3 — 2015-11-23
- 1.0.2 — 2015-06-13
- 1.0.1 — 2015-06-13

## README

# react-native-page-control

Page Control for React Native, like iOS UIPageControl, APIs are same as UIPageControl

## Installation

```bash
$ npm install react-native-page-control --save
```

## Demo

![page control demo](http://silentcloud.github.io/upload/pagecontrol.gif)

## Example

```jsx
import PageControl from 'react-native-page-control';

<PageControl
  style={{position:'absolute', left:0, right:0, bottom:10}}
  numberOfPages={3}
  currentPage={1}
  hidesForSinglePage
  pageIndicatorTintColor='gray'
  currentPageIndicatorTintColor='white'
  indicatorStyle={{borderRadius: 5}}
  currentIndicatorStyle={{borderRadius: 5}}
  indicatorSize={{width:8, height:8}}
  onPageIndicatorPress={this.onItemTap}
/>
```

## API (props)

| Prop | Required | Default  | Type | Description |
| :------------ |:---:|:---------------:| :---------------:| :-----|
| numberOfPages | YES | `0` | `number` | The number of pages the receiver shows (as dots) |
| currentPage | NO | `0` | `number` |The current page, shown by the receiver as a white dot |
| hidesForSinglePage | NO | `false` | `bool` | A Boolean value that controls whether the page control is hidden when there is only one page |
| pageIndicatorTintColor | NO | `gray` | `string` | The tint color to be used for the page indicator. |
| currentPageIndicatorTintColor | NO |`white` | `string`  | The tint color to be used for the current page indicator. |
| indicatorStyle | NO | `{}` | `object` | style for the page indicator |
| currentIndicatorStyle | NO |`{}` | `object`  | style for the current page indicator. |
| onPageIndicatorPress | NO | function(index){} | `func`  | page indicator press hook function. `param: index` current press indicator index|

## Development

  ```bash
  $ yarn
  $ npm run init
  $ npm run start
  $ react-native run-ios
  ```

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