Skip to content

Repository files navigation

Banner

React Native Carousel

@tttstudios/react-native-carousel is a React Native component to make it simple to display a series of images with a crossfade animation between them.

Installation

npm install --save @tttstudios/react-native-carousel or yarn add @tttstudios/react-native-carousel

Installation Requirements

We make use of React hooks so make sure you have at least:

  • React 16.8
  • React Native 0.60

Usage

import{View}from'react-native'import{RNCarousel}from'@tttstudios/react-native-carousel'
...
constbulbasaur=require('./assets/bulbasaur.png')constsquirtle=require('./assets/squirtle.png')constcharmander=require('./assets/charmander.png')constSOURCES=[bulbasaur,squirtle,charmander]...<Viewstyle={{flex: 1}}><RNCarouselsources={SOURCES}/></View>
...

More Advanced Usage

import{RNCarousel}from'@tttstudios/react-native-carousel'
...
constbulbasaur=require('./assets/bulbasaur.png')constsquirtle=require('./assets/squirtle.png')constcharmander=require('./assets/charmander.png')constSOURCES=[bulbasaur,squirtle,charmander]...<RNCarouselsources={SOURCES}onItemIn={()=>console.log('Hello!')}onItemOut={()=>console.log('Bye!')}inFocusDuration={2000}animationDuration={1000}containerStyle={{paddingHorizontal: 20}}contentStyle={{height: '50%'}}/>
...

Parameters

ParameterRequiredDescription
sourcesYESImages to be displayed
onItemIn()NOFunction called when an image goes out of view
onItemOut()NOFunction called when an image comes into view
inFocusDurationNOTime in ms that an image is shown
animationDurationNOTime in ms that the transition between two images takes
containerStyleNOStyling applied to container
contentStyleNOStyling applied to content

Roadmap

  • Typescript definition file
  • Typescript implementation
  • Add basic unit tests
  • Add integration tests
  • Add support for video

Contributors


Odin Mebesius

Premium Support By TTT Studios

react-native-carousel is presented by the mobile team at TTT Studios. We are a Digital Innovation Studio based out of Vancouver, Canada, delivering custom software and solutions that are designed and developed 100% in-house. The technologies we work with include AR & VR, IoT, AI, security & encryption, and cloud computing.

Empowering Business Through Technology

About

A React Native component to display a series of images with a beautiful cross-fade animation between them

Resources

Contributing

Stars

5 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages