npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@03balogun/react-native-images-preview

v0.0.1

Published

A React Native animated custom images preview component.

Downloads

11

Readme

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

| Simple | SwipeDown Close | | :---------------------------------: | :-----------------------------------------: | | alt Default | alt Default |

| DoubleTap Zoom | Pinch Zoom | | :------------------------------------: | :------------------------------------: | | alt Default | alt 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

| Props | Default | Type | Description | |:----------------------| :-----: | :---------------------: |:-----------------------------------------------------------------------------------------------------| | imageSource | - | ImageSourcePropType | Source of image | | imageStyle | - | StyleProp<ImageStyle> | Styling of image | | imageProps | - | ImageProps | Provide image props | | swipeDownCloseEnabled | true | boolean | Enable/Disable swipe down to close modal | | doubleTapZoomEnabled | true | boolean | Enable/Disable double tap to zoom | | pinchZoomEnabled | true | boolean | Enable/Disable pinch to zoom | | renderHeader | - | function | Call back function to render custom header and provide close() in argument | | renderFooter | - | function | Call back function to render custom footer and provide close() in argument | | renderImageLoader | - | function | Call back function to render custom image loader | | errorImageSource | - | ImageSourcePropType | Source of error image | | imageLoaderProps | - | ActivityIndicatorProps | Provide 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