![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
react-native-photos-gallery
Advanced tools
A React Native animated custom photo gallery component
Introducing a cutting-edge Photo Gallery library built with pure JavaScript and React Native Reanimated, designed to enhance your photo gallery experience by allowing you to effortlessly open and view selected photos.
Our user-friendly and highly customizable library ensures a seamless experience. Whether you're an Android or iOS user, our library is compatible with both platforms, guaranteeing optimal performance.
OneColumn List | TwoColumn List | Horizontal List |
---|---|---|
![]() | ![]() | ![]() |
Here's how to get started with react-native-photos-gallery in your React Native project:
Using npm
:
npm install react-native-photos-gallery react-native-reanimated react-native-gesture-handler
Using Yarn
:
yarn add react-native-photos-gallery react-native-reanimated react-native-gesture-handler
cd ios && pod install
Note: Make sure to add Reanimated's babel plugin to your
babel.config.js
module.exports = {
...
plugins: [
...
'react-native-reanimated/plugin',
],
};
const data = [
{
id: number,
source: ImageSourcePropType,
},
];
import React from 'react';
import { SafeAreaView, StyleSheet } from 'react-native';
import { PhotoGallery } from 'react-native-photos-gallery';
export const data = [
{
id: 1,
source: require('./assets/images/apple.jpeg'),
},
{
id: 2,
source: require('./assets/images/apple_icon.jpeg'),
},
{
id: 3,
source: require('./assets/images/DeepPurple.png'),
},
{
id: 4,
source: require('./assets/images/iPhone12.jpeg'),
},
{
id: 5,
source: require('./assets/images/iPhoneX.jpeg'),
},
{
id: 6,
source: require('./assets/images/iphoneXWall.jpg'),
},
{
id: 7,
source: require('./assets/images/112ProMax.jpg'),
},
{
id: 8,
source: {
uri: 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg',
},
},
];
const App = () => {
return (
<SafeAreaView style={styles.screen}>
<PhotoGallery
data={data}
onImageExpand={({ visible }) => console.log(visible)}
animatedImageDelay={60}
modalBackgroundStyle={styles.modalBackgroundStyle}
/>
</SafeAreaView>
);
};
export default App;
const styles = StyleSheet.create({
screen: { flex: 1 },
modalBackgroundStyle: {
backgroundColor: 'white',
},
});
Props | Default | Type | Description |
---|---|---|---|
data | - | Data | Data to render images |
scaledImageResizeMode | 'cover' | ImageResizeMode | Image size mode |
animationCloseSpeed | 350 | Range<200, 500> | Animation close speed between 200 to 500 |
animatedThumbnailScrollSpeed | 30 | 10 | 20 | 30 | Thumbnail List scroll speed |
animatedImageDelay | 90 | 20 | 30 | 60 | 90 | Animated image delay |
thumbnailListImageHeight | 120 | number | Height of thumbnail list image |
thumbnailListImageWidth | 120 | number | Width of thumbnail list image |
thumbnailListImageSpace | 10 | number | Space between thumbnail list images |
renderHeader | - | function | Custom header content instead of default child content and it provide close() as an argument |
onImageExpand | - | function | Function to call when image expanded and it provide {visible} as an argument |
renderNetworkLoader | - | function | Custom network loader instead of default loader |
flatListProps | - | FlatListProps<ArrayData> | Provide flatlist props |
listItemProps | - | ListItemProps | List item props contain containerStyle , imageContainerStyle and imageProps |
modalProps | - | ModalProps | Provide Modal props |
modalBackgroundProps | - | AnimateProps<ViewProps> | Provide animated view props |
modalBackgroundStyle | - | AnimateStyle<ViewStyle> | Modal background style |
modalHeaderProps | - | ModalHeaderProps | Modal header props contain containerProps and containerStyle |
modalContentProps | - | ModalContentProps | Modal content props contain contentProps and contentStyle |
modalContentImageProps | - | AnimateProps<ImageProps> | Modal content Image props |
modalFooterProps | - | ModalFooterProps | Modal footer props contain thumbnailFlatListProps , footerContainerProps and footerContainerStyle |
networkLoaderProps | - | ActivityIndicatorProps | Provide ActivityIndicator props |
networkImageProps | - | ImageProps | Provide Image props |
Props | Default | Type | Description |
---|---|---|---|
containerStyle | - | ViewStyle | Container style |
imageContainerStyle | - | AnimateStyle<ViewStyle> | Image container style |
imageProps | - | AnimateProps<ImageProps> | Image Props |
Props | Default | Type | Description |
---|---|---|---|
containerProps | - | AnimateProps<ViewProps> | Container props |
containerStyle | - | AnimateStyle<ViewStyle> | Container style |
Props | Default | Type | Description |
---|---|---|---|
contentProps | - | AnimateProps<ViewProps> | Content props |
contentStyle | - | AnimateStyle<ViewStyle> | Content style |
Props | Default | Type | Description |
---|---|---|---|
thumbnailFlatListProps | - | FlatListProps<any> | Thumbnail flatlist props |
footerContainerProps | - | AnimateProps<ViewProps> | Container props |
footerContainerStyle | - | AnimateStyle<ViewStyle> | Container style |
A full working example project is here Example
yarn
yarn example ios // For ios
yarn example android // For Android
Support it by joining stargazers for this repository.⭐
For bugs, feature requests, and discussion please use GitHub Issues, GitHub New Feature, GitHub Feedback
We'd love to have you improve this library or fix a problem 💪 Check out our Contributing Guide for ideas on contributing.
FAQs
A React Native animated custom photo gallery component
We found that react-native-photos-gallery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.