0.0.8 • Published 6 years ago

react-native-image-swiper v0.0.8

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

react-native-image-swiper

A Simple Images Slider using react-native-swiper

npm version

Getting Started

  1. init your app
  $ react-native init ImagesSwiperApp
  1. npm install in root
  $ cd ImagesSwiperApp
  $ npm install --save react-native-image-swiper
  1. import ImagesSwiper
  $ import ImagesSwiper from "react-native-image-swiper";

Usage

import ImagesSwiper from "react-native-image-swiper";

const customImg = [
  "https://firebasestorage.googleapis.com/v0/b/lotapp-9e84d.appspot.com/o/aster.jpg?alt=media&token=166e66b0-9c8e-4803-918e-25762c58dbda",
  "https://firebasestorage.googleapis.com/v0/b/lotapp-9e84d.appspot.com/o/fan.jpg?alt=media&token=b419d507-9de8-4c4c-97e3-6b4eb2202e68",
  "https://firebasestorage.googleapis.com/v0/b/lotapp-9e84d.appspot.com/o/stone.jpg?alt=media&token=e9d41537-7f26-4bfd-86eb-c2ef6fc58a9c"
];

class ImagesSwiperApp extends Component {
  render() {
    return (
      <View style={styles.container}>
        <ScrollView style={{flex: 1}}>
          <Text style={styles.welcome}>Default</Text>
          <ImagesSwiper />
          <Text style={styles.welcome}>Custom Images and Styles</Text>
          <ImagesSwiper 
            images={customImg}
            autoplay={true} 
            autoplayTimeout={1.5}
            showsPagination={false}
            width={width} 
            height={height - 400} 
          />
        </ScrollView>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: 30,
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    marginTop: 30,
    marginBottom: 10,
  },
});

Properties

PropTypeDescriptionDefaultRequired
imagesarray of objectsData to be rendered in the slider3 example images in arrayOptional (Recommend that you add it yourself)
autoplayBooleanSet to true enable auto play modefalse (autoplay has currently error on Android's Dev mode)Optional
autoplayTimeoutnumberDelay between auto play transitions (in second).1.5Optional
showsPaginationBooleanSet to true make pagination visiblefalseOptional
widthnumberwidth of image400Optional
heightnumberheight of image400Optional
0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.0.0

7 years ago