Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/machadogj/react-native-carousel-control
React Native Carousel control with support for iOS and Android
https://github.com/machadogj/react-native-carousel-control
Last synced: 19 days ago
JSON representation
React Native Carousel control with support for iOS and Android
- Host: GitHub
- URL: https://github.com/machadogj/react-native-carousel-control
- Owner: machadogj
- License: mit
- Created: 2016-02-22T14:47:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-21T17:08:06.000Z (over 4 years ago)
- Last Synced: 2024-11-11T20:42:56.742Z (about 1 month ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 247
- Watchers: 4
- Forks: 55
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-carousel-control ★199 - React Native Carousel control with support for iOS and Android. (Components / UI)
- awesome-reactnative-ui - react-native-carousel-control
- awesome-react-native - react-native-carousel-control ★199 - React Native Carousel control with support for iOS and Android. (Components / UI)
- awesome-reactnative-ui - react-native-carousel-control
- awesome-react-native - react-native-carousel-control ★199 - React Native Carousel control with support for iOS and Android. (Components / UI)
- awesome-react-native-ui - react-native-carousel-control ★110 - React Native Carousel control with support for iOS and Android. (Components / UI)
- awesome-react-native - react-native-carousel-control ★199 - React Native Carousel control with support for iOS and Android. (Components / UI)
README
# React Native Carousel Control
React Native Carousel with support for both iOS and Android.
![carousel-demo](https://cloud.githubusercontent.com/assets/671212/13221426/1cc2d1fc-d95a-11e5-88d2-3c4d738814e9.gif)React >= 16 -> 2.x.x
React < 16 -> 1.x.x## Installation
```
npm install react-native-carousel-control --save
```## Usage
```
import Carousel from "react-native-carousel-control";
//...Hello
World!
From carousel```
The carousel has the following format:
```
------------
| v--- page
|- ---- -|
| | | | | |
| | | | | |
| | | | | |
|- ---- -|
|^-- sneak |
| ^--- gap
------------
```### pageStyle
Type: `PropTypes.object`
The style that will be applied on the page. For example:
```
```
### pageWidth
Type: `PropTypes.number`
The width of the page. By default it will adjust to `deviceWidth - 100`.
### initialPage
Type: `PropTypes.number`
The index of the initial page. The first page is `0`.
### onPageChange
Type: `PropTypes.func`
This function will be called every time the page changes.
### sneak
Type: `PropTypes.number`
How much of the adjacent pages will display (see format above).
### currentPage
Type: `PropTypes.number`
Update this value to move carousel to a specific page. For example:
```
```
### swipeThreshold
Type: `PropTypes.number`
How much users have to swipe to go to the next/prev page. Default: 0.5 (half the page)
## License
The MIT License (MIT)
Copyright (c) 2016 Gustavo Machado .