UNPKG

2.34 kBMarkdownView Raw
1[npm-badge]: https://img.shields.io/npm/v/react-native-pages.svg?colorB=ff6d00
2[npm-url]: https://npmjs.com/package/react-native-pages
3[license-badge]: https://img.shields.io/npm/l/react-native-pages.svg?colorB=448aff
4[license-url]: https://raw.githubusercontent.com/n4kz/react-native-pages/master/license.txt
5
6# react-native-pages
7
8[![npm][npm-badge]][npm-url]
9[![license][license-badge]][license-url]
10
11Easy to use page view component for React Native
12
13![example](https://cloud.githubusercontent.com/assets/2055622/24577964/2eb771f0-16e0-11e7-9694-a0200716dd56.gif)
14
15## Features
16
17* Easy to use
18* Consistent look and feel on iOS and Android
19* Landscape and portrait orientation support
20* Configurable scroll direction
21* Configurable page indicator position, color and opacity
22* Animated page indicator
23* Pure javascript implementation
24
25## Roadmap
26
27### 0.2.0
28
29* Custom page indicator
30* Methods next(), prev() and currentPage()
31
32### 0.3.0
33
34* Parallax support
35
36## Installation
37
38```bash
39npm install --save react-native-pages
40```
41
42## Usage
43
44```javascript
45import React, { Component } from 'react';
46import { Pages } from 'react-native-pages';
47
48class Example extends Component {
49 render() {
50 return (
51 <Pages>
52 <View style={{ flex: 1, backgroundColor: 'red' }} />
53 <View style={{ flex: 1, backgroundColor: 'green' }} />
54 <View style={{ flex: 1, backgroundColor: 'blue' }} />
55 </Pages>
56 );
57 }
58}
59```
60
61## Properties
62
63name | description | type | default
64-------------------- | ----------------------------------------- | --------:| --------------------------
65horizontal | Scroll direction | Boolean | true
66indicatorColor | Page indicator color | String | rgb(255, 255, 255)
67indicatorOpacity | Page indicator opacity (inactive dots) | Number | 0.30
68indicatorPosition | Page indicator position | String | horizontal? bottom : right
69onScrollEnd | Scroll end callback | Function | -
70
71## Example
72
73```bash
74git clone https://github.com/n4kz/react-native-pages
75cd react-native-pages/example
76npm install
77react-native run-ios # or run-android
78```
79
80## Copyright and License
81
82BSD License
83
84Copyright 2017 Alexander Nazarov. All rights reserved.