1.0.1 • Published 3 years ago
react-native-carousel-image-slider v1.0.1
Installation
$ npm i --save react-native-carousel-image-sliderOR
$ yarn add react-native-carousel-image-sliderBasic Usage
Class Component:
import React from "react";
import { View } from "react-native";
import { CarouselSlider } from "react-native-carousel-image-slider";
export class App extends React.Component {
constructor(props) {
super(props);
this.state = {
images: [],
};
}
render() {
return (
<View style={{ width: "100%", flex: 1, padding: 24 }}>
<CarouselSlider images={this.state.images} />
</View>
);
}
}Function Component:
import React, { useState } from "react";
import { View } from "react-native";
import { CarouselSlider } from "react-native-carousel-image-slider";
export default function App() {
const [images, setImages] = useState([]);
return (
<View style={{ width: "100%", flex: 1, padding: 24 }}>
<CarouselSlider images={images} />
</View>
);
}Props
images:string[];renderDots?:boolean;onImagePress?:((event: GestureResponderEvent) => void) | undefined;activeDotColor?:string;inactiveDotColor?:string;dotStyle?:ViewStyle;resizeMethod?:"auto" | "resize" | "scale";resizeMode?:ImageResizeMode;imageStyle?:ImageStyle;disabledOnPress?:boolean;buttonActiveOpacity?:number;
Contributing
- Fork or clone this repository
$ git clone https://github.com/GusttavoCastilho/react-native-carousel-image-slider.git