All Projects → dohooo → react-native-reanimated-carousel

dohooo / react-native-reanimated-carousel

Licence: MIT license
🎠 React Native swiper/carousel component, fully implemented using reanimated v2, support to iOS/Android/Web. (Swiper/Carousel)

Programming Languages

typescript
32286 projects
java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to react-native-reanimated-carousel

React Native Snap Carousel
Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
Stars: ✭ 9,151 (+526.35%)
Mutual labels:  infinite-scroll, carousel, swiper
Flutter swiper
The best swiper for flutter , with multiple layouts, infinite loop. Compatible with Android & iOS.
Stars: ✭ 3,209 (+119.64%)
Mutual labels:  carousel, swiper
pinar
🌲☀️ Customizable, lightweight React Native carousel component with accessibility support.
Stars: ✭ 214 (-85.35%)
Mutual labels:  carousel, swiper
Tiny Swiper
Ingenious JavaScript Carousel powered by wonderful plugins. Lightweight yet extensible. Import plugins as needed, No more, no less.
Stars: ✭ 1,061 (-27.38%)
Mutual labels:  carousel, swiper
Vue Slick Carousel
🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
Stars: ✭ 447 (-69.4%)
Mutual labels:  carousel, swiper
stimulus-carousel
A Stimulus controller to deal with carousel.
Stars: ✭ 22 (-98.49%)
Mutual labels:  carousel, swiper
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+1920.47%)
Mutual labels:  carousel, swiper
react-native-chi-page-control
Cool page control animations written in React Native
Stars: ✭ 18 (-98.77%)
Mutual labels:  react-native-carousel, react-native-swiper
infinite-carousel-flutter
Carousel in flutter. Supports infinite looping and gives control over anchor and velocity.
Stars: ✭ 24 (-98.36%)
Mutual labels:  infinite-scroll, carousel
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (-29.43%)
Mutual labels:  infinite-scroll, carousel
InfiniteCarousel
💈Infinite Carousel Collection View
Stars: ✭ 67 (-95.41%)
Mutual labels:  infinite-scroll, carousel
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (-85.15%)
Mutual labels:  carousel, swiper
react-native-carousel
React Native carousel
Stars: ✭ 35 (-97.6%)
Mutual labels:  infinite-scroll, carousel
Scroll Snap Carousel
Carousel based on CSS Scroll Snap functionality
Stars: ✭ 31 (-97.88%)
Mutual labels:  snap, carousel
react-use-infinite-loader
♾️ 📃 ⏳ Super lightweight infinite loading hook for React apps
Stars: ✭ 15 (-98.97%)
Mutual labels:  infinite-scroll
infy-scroll
A web extension for Chrome, Edge, and Firefox. Add customized infinite scrolling to websites and auto load the next page. Supports the AutoPagerize Database. (Beta)
Stars: ✭ 70 (-95.21%)
Mutual labels:  infinite-scroll
react-native-animateable-text
🆎 A fork of React Native's <Text/> component that supports Animated Values!
Stars: ✭ 263 (-82%)
Mutual labels:  reanimated
amazin
A MERN-stack app for eCommerce platform, Webshop, Web Store. Storybook: https://www.amazin.one/ Alternative: https://ntrix.github.io/amazin-story
Stars: ✭ 27 (-98.15%)
Mutual labels:  swiper
nextcloud-snap
☁️📦 Nextcloud packaged as a snap
Stars: ✭ 1,445 (-1.1%)
Mutual labels:  snap
simple-infinite-scroll
Django Simple Infinite Scroll
Stars: ✭ 35 (-97.6%)
Mutual labels:  infinite-scroll

English | 简体中文

react-native-reanimated-carousel

Hacktober Badge platforms npm npm npm github issues github closed issues discord chat

ReactNative community's best use of the carousel component! 🎉🎉🎉

  • It completely solves this [problem] for react-native-snap-carousel!
  • Simple, Infinitely scrolling very smooth, Fully implemented using Reanimated 2!

V2 has been released! Join it! [v1 docs]

Support to Web [demo]

Click on the image to see the code snippets. [Try it] 🍺

normal-horizontal normal-vertical parallax-horizontal
parallax-vertical stack-horizontal-left stack-horizontal-right
stack-vertical-left stack-vertical-right stack-horizontal-right
left-align

Now you can make cool animations with us! Very easy! [Details]

advanced-parallax pause-advanced-parallax scale-fade-in-out
rotate-scale-fade-in-out rotate-in-out anim-tab-bar
marquee multiple circular
fold tear press-swipe
cube-3d blur-parallax curve
parallax-layers stack-cards flow

Table of contents

  1. Installation
  2. Usage
  3. Props
  4. Tips
  5. Reason
  6. Example

Installation

Open a Terminal in the project root and run:

yarn add react-native-reanimated-carousel

Or if you use npm:

npm install react-native-reanimated-carousel

Now we need to install react-native-gesture-handler and react-native-reanimated(>=2.0.0).

react-native-reanimated react-native-gesture-handler
react-native-reanimated-carousel < v3 <2.7.0 *
react-native-reanimated-carousel >= v3 >=2.7.0 *

Usage

import * as React from 'react';
import { Dimensions, Text, View } from 'react-native';
import Carousel from 'react-native-reanimated-carousel';

function Index() {
    const width = Dimensions.get('window').width;
    return (
        <View style={{ flex: 1 }}>
            <Carousel
                loop
                width={width}
                height={width / 2}
                autoPlay={true}
                data={[...new Array(6).keys()]}
                scrollAnimationDuration={1000}
                onSnapToItem={(index) => console.log('current index:', index)}
                renderItem={({ index }) => (
                    <View
                        style={{
                            flex: 1,
                            borderWidth: 1,
                            justifyContent: 'center',
                        }}
                    >
                        <Text style={{ textAlign: 'center', fontSize: 30 }}>
                            {index}
                        </Text>
                    </View>
                )}
            />
        </View>
    );
}

export default Index;

Tips

  • Optimizing

    • When rendering a large number of elements, you can use the 'windowSize' property to control how many items of the current element are rendered. The default is full rendering. After testing without this property, frames will drop when rendering 200 empty views. After setting this property, rendering 1000 empty views is still smooth. (The specific number depends on the phone model tested)
  • Used in ScrollView/FlastList

    • #143 - Carousel suppresses ScrollView/FlastList scroll gesture handler: When using a carousel with a layout oriented to only one direction (vertical/horizontal) and inside a ScrollView/FlatList, it is important for the user experience that the unused axis does not impede the scroll of the list. So that, for example, the x-axis is free we can change the activeOffsetX of the gesture handler:

      <Carousel
        {...}
        panGestureHandlerProps={{
          activeOffsetX: [-10, 10],
        }}
      />
  • RTL

    • Support to RTL mode with no more configuration needed. But in RTL mode, need to manually set the autoPlayReverse props for autoplay to control scrolling direction.
  • EXPO

    • If use EXPO managed workflow please ensure that the version is greater than 41.Because the old version not support Reanimated(v2).
  • Working principle

  • How to run tests in exampleExpo

    $ yarn prepare
    $ yarn link --global
    $ cd ./exampleExpo
    $ yarn link react-native-reanimated-carousel --global
    $ yarn test

Reason

The common RN infinite scroll component. It get stuck on a fast slide. Wait for the next element to appear. This component will not have similar problems.Because using a completely different approach so the best performance is achieved.That's why this library was created.

Use react-native-snap-carousel for quick swiping,you can see caton clearly when you reach the junction.(gif 4.6mb)

Compared with react-native-reanimated-carousel,The actual test was ten slides per second, but it didn't show up very well in gif.

Example

:pretty use pretty images

yarn ios
yarn ios:pretty

yarn android
yarn android:pretty

yarn web
yarn web:pretty

Sponsors

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].