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

react-native-zoom-reanimated

v1.4.8

Published

Zoom component on react-native + react-native-reanimated + react-native-gesture-handler

Downloads

20,989

Readme

react-native-zoom-reanimated

Zoom component on React Native + react-native-reanimated + react-native-gesture-handler

  • You can zoom any View, Image or whatever
  • Can be used in FlatList (see Preview below)
  • Double tap to zoom in or zoom out
  • Automatically bounces to borders when paning outside of container and leaving the touch

Preview

iOS preview

iOS Preview

Android preview

Android Preview

Getting started

Install the library using either Yarn:

yarn add react-native-zoom-reanimated

or npm:

npm install --save react-native-zoom-reanimated

Required peer dependencies

| dependency | required version | |:----------------------------:|:----------------:| | react-native-reanimated | >= 2.0.0 | | react-native-gesture-handler | >= * |

Usage

import Zoom from 'react-native-zoom-reanimated'

Example

import Zoom from 'react-native-zoom-reanimated'

...
  <Zoom>
    <Image
      source={{ uri: ... }}
      resizeMode='contain'
      style={{
        width: deviceWidth,
        height: imageHeight * deviceWidth / imageWidth,
       }}
    />
  </Zoom>
...

Parameters

| Name | Type | Required | Description | |-----------------------|------------------------|----------|------------------| | style | StyleProp<ViewStyle> | No | Container style | | contentContainerStyle | StyleProp<ViewStyle> | No | Content container style | | animationFunction | function | No | Animation function from react-native-reanimated. Default: withTiming. For example, you can use withSpring instead: https://docs.swmansion.com/react-native-reanimated/docs/api/animations/withSpring | | animationConfig | object | No | Config for animation function from react-native-reanimated. For example, avaiable options for withSpring animation: https://docs.swmansion.com/react-native-reanimated/docs/api/animations/withSpring#options-object | | doubleTapConfig | { defaultScale?: number, minZoomScale?: number, maxZoomScale?: number } | No | Config for zoom on double tap. defaultScale - if you want to have fixed zoom on double tap, or calculated based on dimensions then leave it as it is. minZoomScale and maxZoomScale define range with min zoom & max zoom on double tap |

License

The library is released under the MIT licence. For more information see LICENSE.

TODO

  • document useZoomGesture
  • add examples of usage Zoom (with or without different configs), useZoomGesture with react-native app code
  • add examples of list of images with FlatList
  • make list component with https://github.com/callstack/react-native-pager-view and export it for galleries usecase