Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-images-preview

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-images-preview

A React Native animated custom images preview component.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ImagesPreview - Simform

react-native-images-preview

npm version Android iOS MIT

Introducing an image preview built with pure JavaScript and leveraging React Native Reanimated and GesturesHandler, enabling full-screen image previewing and zooming via double-tap and pinch gestures for effortless integration into applications.

Our library is designed to be highly customizable, allowing developers to tailor it to their specific needs, such as changing the colors, styles, and other visual elements. Whether you're an Android or iOS user, our library is compatible with both platform, guaranteeing optimal performance.

🎬 Preview

SimpleSwipeDown Close
alt Defaultalt Default
DoubleTap ZoomPinch Zoom
alt Defaultalt Default

Quick Access

Getting Started 🔧

Here's how to get started with react-native-images-preview in your React Native project:

Installation

1. Install the package

Using npm:

npm install react-native-images-preview react-native-reanimated react-native-gesture-handler

Using yarn:

yarn add react-native-images-preview react-native-reanimated react-native-gesture-handler
2. Install cocoapods in the ios project
cd ios && pod install

Note: Make sure to add Reanimated's babel plugin to yourbabel.config.js

module.exports = {
      ...
      plugins: [
          ...
          'react-native-reanimated/plugin',
      ],
  };

Note: For React Native 0.61 or greater, add react-native-gesture-handler in index.js file.

import 'react-native-gesture-handler';
Know more about react-native-reanimated and react-native-gesture-handler

Usage

import React from 'react';
import { StyleSheet, View } from 'react-native';
import { ImagePreview } from 'react-native-images-preview';
import { images } from './assets';

const App = () => {
  return (
    <View style={styles.screen}>
      <ImagePreview
        imageSource={images.forest}
        imageStyle={styles.imageStyle}
      />
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  screen: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  imageStyle: {
    height: 150,
    width: 250,
  },
});
🎬 Preview

alt Default

Properties

PropsDefaultTypeDescription
imageSource-ImageSourcePropTypeSource of image
imageStyle-StyleProp<ImageStyle>Styling of image
imageProps-ImagePropsProvide image props
swipeDownCloseEnabledtruebooleanEnable/Disable swipe down to close modal
doubleTapZoomEnabledtruebooleanEnable/Disable double tap to zoom
pinchZoomEnabledtruebooleanEnable/Disable pinch to zoom
renderHeader-functionCall back function to render custom header and provide close() in argument
renderImageLoader-functionCall back function to render custom image loader
errorImageSource-ImageSourcePropTypeSource of error image
imageLoaderProps-ActivityIndicatorPropsProvide ActivityIndicator props
Know more about ImageProps, ActivityIndicatorProps

Example

A full working example project is here Example

yarn
yarn example ios   // For ios
yarn example android   // For Android

Find this library useful? ❤️

Support it by joining stargazers for this repository.⭐

Bugs / Feature requests / Feedbacks

For bugs, feature requests, and discussion please use GitHub Issues, GitHub New Feature, GitHub Feedback

🤝 How to Contribute

We'd love to have you improve this library or fix a problem 💪 Check out our Contributing Guide for ideas on contributing.

Awesome Mobile Libraries

License

Keywords

FAQs

Package last updated on 25 May 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc