11English | [ 简体中文] ( ./README.zh-CN.md )
22
33# react-native-reanimated-carousel
4- <img src =" assets/54995FB4-3F72-48E4-BA5D-0A859D8EBD92.png " width =" 100% " />
4+
5+ <img src =" assets/54995FB4-3F72-48E4-BA5D-0A859D8EBD92.png " width =" 100% " />
56
67![ platforms] ( https://img.shields.io/badge/platforms-Android%20%7C%20iOS-brightgreen.svg?style=flat-square&colorB=191A17 )
78[ ![ npm] ( https://img.shields.io/npm/v/react-native-reanimated-carousel.svg?style=flat-square )] ( https://www.npmjs.com/package/react-native-reanimated-carousel )
@@ -10,17 +11,33 @@ English | [简体中文](./README.zh-CN.md)
1011[ ![ github closed issues] ( https://img.shields.io/github/issues-closed/dohooo/react-native-reanimated-carousel.svg?style=flat-square&colorB=44cc11 )] ( https://github.com/dohooo/react-native-reanimated-carousel/issues?q=is%3Aissue+is%3Aclosed )
1112
1213<p align =" center " >
13- <img width = " 300 " src =" ./ assets/example-01 .gif" >
14+ <img src =" assets/normal .gif " width = " 300 " />
1415</p >
1516
1617<br />
1718
18- ### 🎉 ** Simple、Infinitely scrolling very smooth、Fully implemented using Reanimated 2!**
19+ ## Reason
20+
21+ 🎉 ** Simple、Infinitely scrolling very smooth、Fully implemented using Reanimated 2!**
1922
2023> The common RN infinite scroll component. It's common to get stuck on a fast slide. Wait for the next element to appear. This component will not have similar problems. That's why this library was created.
2124
2225> At present, it only meets the needs of my work. Welcome to raise PR/ISSUES.[ Try it with snack] ( https://snack.expo.dev/@zhaodonghao586/simple-carousel )
2326
27+ <p align =" center " >
28+ Use react-native-snap-carousel for quick swiping,you can see caton clearly when you reach the junction.(gif 4.6mb)
29+ </p >
30+ <p align =" center " >
31+ <img src =" assets/react-native-snap-carousel.gif " width =" 50% " />
32+ </p >
33+
34+ <p align =" center " >
35+ Compared with react-native-reanimated-carousel,The actual test was ten slides per second, but it didn't show up very well in gif.(gif 83mb)
36+ </p >
37+ <p align =" center " >
38+ <img src =" assets/fast.gif " width =" 50% " />
39+ </p >
40+
2441---
2542
2643## Installation
@@ -69,24 +86,24 @@ import Carousel from "react-native-reanimated-carousel";
6986
7087## Props
7188
72- | name | required | default | types | description |
73- | ----------------------- | -------- | --------------- | ------------------------------------------- | ------------------------------------------------------------------------------ |
74- | data | ✅ | | T[ ] | Carousel items data set |
75- | width | ✅ | | number | Specified carousel container width |
76- | renderItem | ✅ | | (data: T, index: number) => React.ReactNode | Render carousel item |
77- | autoPlay | ❌ | false | boolean | Auto play |
78- | autoPlayReverse | ❌ | false | boolean | Auto play reverse playback |
79- | autoPlayInterval | ❌ | 1000 | autoPlayInterval | Auto play playback interval |
80- | mode | ❌ | defalut | 'default'\| 'parallax' | Carousel Animated transitions |
81- | loop | ❌ | true | boolean | Carousel loop playback |
89+ | name | required | default | types | description |
90+ | ----------------------- | -------- | --------------- | ------------------------------------------- | ------------------------------------------------------------------------------- |
91+ | data | ✅ | | T[ ] | Carousel items data set |
92+ | width | ✅ | | number | Specified carousel container width |
93+ | renderItem | ✅ | | (data: T, index: number) => React.ReactNode | Render carousel item |
94+ | autoPlay | ❌ | false | boolean | Auto play |
95+ | autoPlayReverse | ❌ | false | boolean | Auto play reverse playback |
96+ | autoPlayInterval | ❌ | 1000 | autoPlayInterval | Auto play playback interval |
97+ | mode | ❌ | defalut | 'default'\| 'parallax' | Carousel Animated transitions |
98+ | loop | ❌ | true | boolean | Carousel loop playback |
8299| parallaxScrollingOffset | ❌ | 100 | number | When use 'parallax' Layout props,this prop can be control prev/next item offset |
83100| parallaxScrollingScale | ❌ | 0.8 | number | When use 'parallax' Layout props,this prop can be control prev/next item scale |
84- | style | ❌ | {} | ViewStyle | Carousel container style |
85- | height | ❌ | '100%' | undefined \| string \| number | Specified carousel container height |
86- | timingConfig | ❌ | {duration: 250} | Animated.WithTimingConfig | Timing config of translation animated |
87- | onSnapToItem | ❌ | | (index: number) => void | Callback fired when navigating to an item |
88- | onScrollBegin | ❌ | | () => void | Callback fired when scroll begin |
89- | onScrollEnd | ❌ | | (previous: number, current: number) => void | Callback fired when scroll end |
101+ | style | ❌ | {} | ViewStyle | Carousel container style |
102+ | height | ❌ | '100%' | undefined \| string \| number | Specified carousel container height |
103+ | timingConfig | ❌ | {duration: 250} | Animated.WithTimingConfig | Timing config of translation animated |
104+ | onSnapToItem | ❌ | | (index: number) => void | Callback fired when navigating to an item |
105+ | onScrollBegin | ❌ | | () => void | Callback fired when scroll begin |
106+ | onScrollEnd | ❌ | | (previous: number, current: number) => void | Callback fired when scroll end |
90107
91108## Ref
92109
0 commit comments