npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@natuanorg/react-native-reanimated-carousel

v2.3.12

Published

Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.

Downloads

2

Readme

English | 简体中文

react-native-reanimated-carousel

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!
  • SimpleInfinitely scrolling very smoothFully 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] 🍺

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

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).

Usage

import Carousel from 'react-native-reanimated-carousel';

<Carousel
    width={300}
    height={150}
    data={[1, 2, 3]}
    renderItem={({ item }) => <AnyElement />}
/>;

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).

Reason

Example

:pretty use pretty images

yarn ios
yarn ios:pretty

yarn android
yarn android:pretty

yarn web
yarn web:pretty

Sponsors

License

MIT