React Native Animated Image Slider
Welcome to our React Native Animated Image Slider! This library is inspired by the beautiful and intuitive design of Apple's Memories app, bringing a touch of elegance to your React Native applications.
Our Animated Image Slider is not just a simple carousel of images. It's a dynamic, interactive, and visually appealing component that enhances the user experience. With smooth transitions and subtle animations, users can easily navigate through their favorite photos or any other content.
Table of Content:
How it looks
Installation
npm i rn-animated-image-slider --save
or
yarn add rn-animated-image-slider
Example
Take a look into example folder
To execute the example using Expo run the following command:
yarn run run:example
How to use it
Step 1: Import the ImageSlider
component:
import { ImageSlider } from "rn-animated-image-slider";
Second step: define the slides
const slides = [
{
source: {uri: 'https://picsum.photos/id/16/1000/800'},
},
{
source: {uri: 'https://picsum.photos/id/17/1000/800'},
},
{
source: {uri: 'https://picsum.photos/id/18/1000/800'},
},
];
or pass local image
const actions = [
{
source: require('@/assets/image1.png'),
},
{
source: require('@/assets/image2.png'),
},
{
source: require('@/assets/image3.png'),
},
];
Third step: use it
<View style={styles.container}>
<Text style={styles.example}>Animated Slider example</Text>
<ImageSlider
slides={slides}
title={'Slider title'}
date={new Date().toLocaleDateString("en-US", { day: 'numeric', month: 'short', year: 'numeric' })}
onGalleryPress={() => console.log('gallery Pressed')}
onControllersVisibleChange={isVisible =>
console.log(`isController visible ${isVisible}`)
}
onMutePress={() => console.log('on mute press')}
onPausePress={() => console.log('on pause press')}
/>
</View>
Props
containerStyle: ViewStyle
slides: Array<{ source: ImageSourcePropType }>
onGalleryPress: () => void
onMutePress: (isMute: boolean) => void
onPausePress: (isPaused: boolean) => void
onControllersVisibleChange: (isControllersVisible: boolean) => void
title: string
titleStyle: TextStyle
date: string
dateStyle: TextStyle
controllerComponent: () => JSX.Element
slideContainerStyle: ViewStyle
controllerContainerStyle: ViewStyle
sliderWidth: number
sliderHeight: number
rotateDegree: number
slideDuration: number
sizeIcon: number
TODO