1.1.2 • Published 7 years ago

react-native-galery-carousel v1.1.2

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

react-native-galery-carousel

Galery carousel for react native

Demo

react-native-galery-carousel react-native-galery-carousel

Usage

$ npm install --save react-native-galery-carousel
const imagesDemo = [
    {
        path: '/UYiroysl.jpg'
    },
    {  
        path: '/UPrs1EWl.jpg'
    },
    {    
        path: '/MABUbpDl.jpg'
    },
    {    
        path: '/KZsmUi2l.jpg'
    },
    {    
        path: '/2nCt3Sbl.jpg'
    },
    {    
        path: '/lceHsT6l.jpg'
    }
];
import GaleryCarousel from 'react-native-galery-carousel';

    render () {
      <View>
        <GaleryCarousel
          dataImage={imagesDemo}
          joinFirst={'http://i.imgur.com'}
          defaultImageIndex={2}
          onLongPress={(key,element)=>{console.log(key,element)}}
          mainImageComponents={
            <View style={{flex:1,backgroundColor:"transparent"}}>
              <Text style={{color:"#fff"}}>Hello</Text>
            </View>
          }
        />
      </View>
    }

Props

PropDescriptionTypeDefault
dataImagethe array of the image to show in the carouselarray[]
getImageFromthe key of the array where you wanna get the imagestring"path"
joinFirstif you wanna join a link before example https://my-host-name.com/ pathstring""
joinLastif you wanna join string after example path/key="1255665"string""
defaultImageIndexindex of the first image to showNumber1
mainImageComponentsif you wanna render a component in the Main imageComponent<View/>
mainHeightsize of the galery carouselNumber280
onLongPresseach item of the carouselfunctionfunction

TODO

  • Implement 'onLongPress' in the scrollView images