|
1 |
| -# react-native-scroll-view |
2 |
| -The Parallax ScrollView component we all deserve. :rocket: |
| 1 | +<p align="center"> |
| 2 | + <a href="https://github.com/Monte9/react-native-scroll-view"> |
| 3 | + <img alt="react-native-scroll-view" src="" width="450"> |
| 4 | + </a> |
| 5 | +</p> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + The (Parallax) ScrollView component we all deserve. :rocket: |
| 9 | +</p> |
| 10 | + |
| 11 | +<p align="center"> |
| 12 | + <a href="https://www.npmjs.com/package/react-native-scroll-view"><img src="https://img.shields.io/npm/v/react-native-scroll-view.svg?style=flat-square"></a> |
| 13 | + <a href="https://www.npmjs.com/package/react-native-scroll-view"><img src="https://img.shields.io/npm/dm/react-native-scroll-view.svg?style=flat-square"></a> |
| 14 | +</p> |
| 15 | + |
| 16 | +## Demo |
| 17 | + |
| 18 | +![Demo gif]() |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +Install the package using yarn or npm: |
| 23 | + |
| 24 | +```yarn add react-native-scroll-view``` or ```npm i react-native-scroll-view``` |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +``` js |
| 29 | +import ParallaxScrollView from 'react-native-scroll-view'; |
| 30 | + |
| 31 | +<ParallaxScrollView /> |
| 32 | +``` |
| 33 | + |
| 34 | +## API |
| 35 | + |
| 36 | +| prop | default | type | description | |
| 37 | +| ---- | ---- | ----| ---- | |
| 38 | +| **onFinishRating** | none | function | Callback method when the user finishes rating. Gives you the final rating value as a whole number **(required)** | |
| 39 | +| type | star | string | Choose one of the built-in types: `star`, `rocket`, `bell`, `heart` or use type `custom` to render a custom image (optional) | |
| 40 | +| ratingImage | star | string | Pass in a custom image source; use this along with `type='custom'` prop above (optional) | |
| 41 | +| ratingColor | #f1c40f | string (color) | Pass in a custom fill-color for the rating icon; use this along with `type='custom'` prop above (optional) | |
| 42 | +| ratingBackgroundColor | white | string (color) | Pass in a custom background-fill-color for the rating icon; use this along with `type='custom'` prop above (optional) | |
| 43 | +| ratingCount | 5 | number | The number of rating images to display (optional) | |
| 44 | +| imageSize | 50 | number | The size of each rating image (optional) | |
| 45 | +| showRating | none | boolean | Displays the Built-in Rating UI to show the rating value in real-time (optional) | |
| 46 | +| style | none | function | Exposes style prop to add additonal styling to the container view (optional) | |
| 47 | + |
| 48 | + |
| 49 | +## Try it out |
| 50 | + |
| 51 | +You can try it out with Exponent [here](https://exp.host/@monte9/react-native-graphql-todolist). |
| 52 | + |
| 53 | +### Example |
| 54 | + |
| 55 | +Look at the [`example`](https://github.com/Monte9/react-native-scroll-view/tree/master/example) folder to run the expo app locally. |
| 56 | + |
| 57 | +## Motivation |
| 58 | + |
| 59 | +There are only two packages that provide a similar parallax scroll view ([here](https://github.com/jaysoo/react-native-parallax-scroll-view) and [here](https://github.com/lelandrichardson/react-native-parallax-view)) and both of them are not maintained. |
| 60 | + |
| 61 | +I really liked [react-native-parallax-view](https://github.com/lelandrichardson/react-native-parallax-view) but there were a coupe things I didn't like about it: |
| 62 | +1. It was outdated and not maintained. |
| 63 | +2. It didn't have a Sticky NavBar when scrolling |
| 64 | + |
| 65 | +So I set out to create a Parallax ScrollView (using [react-native-parallax-view](https://github.com/lelandrichardson/react-native-parallax-view) as a base) with |
| 66 | +1. Sticky headers, |
| 67 | +2. Super simple usage |
| 68 | +3. Flexible and comprehensive API. |
| 69 | + |
| 70 | +aka it's a (Parallax) ScrollView component for React Native that we truly deserve with. :tada: |
| 71 | + |
| 72 | +## Feedback |
| 73 | + |
| 74 | +This repo is being actvely manitained. Feel free to open a new Issue with a `Feature Request` or submit a PR with an `Enhancement`. |
0 commit comments