react-native-stack-carousel
v1.0.2
Published
A React Native component for creating an animated stack carousel with customizable directions and gestures.
Downloads
39
Maintainers
Readme
Example
Here's a basic example of how to use the Carousel
component:
import React from "react";
import { View, StyleSheet } from "react-native";
import { useSharedValue } from "react-native-reanimated";
import Carousel from "react-native-stack-carousel";
const App = () => {
const currentIndex = useSharedValue(0);
const animatedValue = useSharedValue(0);
const IMAGES = [
{ id: 1, uri: "https://example.com/image1.jpg" },
{ id: 2, uri: "https://example.com/image2.jpg" },
{ id: 3, uri: "https://example.com/image3.jpg" },
];
return (
<View style={styles.container}>
<Carousel
data={IMAGES}
maxVisibleItems={6}
direction="vertical-top-variant1"
/>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#fff",
},
});
export default App;