0.0.18 • Published 6 years ago
rn-infinite-carousel v0.0.18
RN Infinite Carousel
Installation
npm i rn-infinite-carousel --saveUsage
import React from 'react';
import { StyleSheet, Text, View, Dimensions } from 'react-native';
import { Slider } from 'rn-infinite-carousel';
function Slide({ text, color }) {
return (
<View style={{ ...styles.slide, backgroundColor: color }}>
<Text style={styles.text}>{text}</Text>
</View>
);
}
export default function App() {
return (
<View style={styles.container}>
<Slider width={styles.slide.width} height={styles.slide.height}>
<Slide text="slide 1" color="black"></Slide>
<Slide text="slide 2" color="green"></Slide>
<Slide text="slide 3" color="blue"></Slide>
</Slider>
</View>
);
}
const styles = StyleSheet.create({
slide: {
width: Dimensions.get('screen').width,
height: 400,
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: 'white',
},
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});0.0.18
6 years ago
0.0.14
6 years ago
0.0.15
6 years ago
0.0.16
6 years ago
0.0.17
6 years ago
0.0.12
6 years ago
0.0.13
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.5
6 years ago
0.0.6
6 years ago
0.0.3
6 years ago
0.0.4
6 years ago
0.0.1
6 years ago
0.0.2
6 years ago
0.0.0
6 years ago