1.0.5 • Published 4 years ago

react-native-image-slider-text-box v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-native-image-slider-with-text

Install

  1. First, install our library | use below npm script

    npm i react-native-image-slider-with-text

    yarn add react-native-image-slider-with-text

Usage :

list of available props for customization SliderBox:

PropsValue TypeDescription
ImageComponentImage component, default as Imagedefault value is React-native Image, if you use third-party library like FastImage use this property
imagesArray of image path(or url) as stringSet array of images path- these paths can contain http url link or local images path using require('./pathOfImage')
onCurrentImagePressedhandler function callbackcallback for get pressed image index (index start from 0)
currentImageEmitterhandler function callbackcallback for get current image index (index start from 0)
disableOnPressbooleanif present, then onCurrentImagePressed will be disabled
sliderBoxHeightint valuedefault value = 200, you can change height of image slider box
parentWidthintdefault = screen.width ; in advance mode, if parent is smaller, you can change it. best practice is use onLayout handler in parent component or screen.
dotColorcolor string codechange color of paging dot
inactiveDotColorcolor string codechange color of inactive paging dot
dotStylestyle objectdefault style is : {width: 10,height: 10,borderRadius: 5,marginHorizontal: 0,padding: 0,margin: 0,} change style of paging dots if you want
paginationBoxVerticalPaddingint valuedefault = 10 ; change the height of paging dots from bottom of Slider-Box
autoplaybool valuedefault = false
circleLoopboolean - attributeif set, when user swiped to last image circularly return to the first image again.
paginationBoxStyleobject,default values use lib stylecustomize pagination box
dotStyleobject,default use lib stylecustomize dot styles
resizeMethodstringdefault is resize
resizeModestringdefault is cover
ImageComponentStyleobject{} style object for ImageComponent
imageLoadingColorstringdefault is #E91E63 , image loading indicator color
ImageLoaderReact component, default as ActivityIndicatordefault value is React-native ActivityIndicator.
firstItemnumberdefault is 0 , index of image to display when slider box loads

##example:

const banners=[{'img':'imagestring','buttonText':'buttonText ','title':'title1'},
                  {'img':'imagestring2','buttonText':'buttonText ','title':'title3'},
                  {'img':'imagestring3','buttonText':'buttonText ','title':'title3'}]
<SliderBox
          images={banners}
          sliderBoxHeight={height}

          parentWidth={width}
          onCurrentImagePressed={index => {console.log('index')}}
          dotColor="#FFEE58"
          inactiveDotColor="#90A4AE"
          paginationBoxVerticalPadding={20}
          autoplay
          circleLoop

          resizeMode={'cover'}
        />

Notice:

This library use react-native-image-slider-box and make easier way to create image slider box with full customization ability.

See original Library https://github.com/intellidev1991/react-native-image-slider-box

we dont edit or modify original library, we just use it with some additional style. (BSD 3 License)