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

@dailyy-app/react-native-image-zoom

v2.1.2

Published

A performant zoomable image written in Reanimated v2+ ๐Ÿš€

Downloads

31

Readme

REACT NATIVE IMAGE ZOOM

npm NPM npm peer dependency version npm peer dependency version npm bundle size npm npms.io (final) GitHub issues

A performant and customizable image zoom component
built with Reanimated v2+ and TypeScript. ๐ŸŒƒ ๐Ÿš€

Demo:

React Native Image Zoom

Features

  • Smooth Zooming Gestures: Smooth and responsive zooming functionality, allowing users to zoom in and out of images using intuitive pinch and pan gestures.
  • Customizable Zoom Settings: With the minScale and maxScale props, you can set the minimum and maximum zoom levels for your images, giving you precise control over the zooming experience.
  • Reset zoom and snap back: The component automatically resets zoom and snaps back to the initial position when the gesture ends.
  • Interactive Callbacks: The component provides interactive callbacks such as onInteractionStart, onInteractionEnd, onPinchStart, onPinchEnd, onPanStart, and onPanEnd that allow you to handle image interactions and customize the user experience.
  • Reanimated: Compatible with Reanimated v2 & Reanimated v3.
  • Written in TypeScript: The library is written in TypeScript, providing type safety and improving the maintainability of your code.
  • Full React Native Image Props Support: The component supports all React Native Image props, making it easy to integrate with existing code and utilize all the features that React Native Image provides.

Getting Started

To use the ImageZoom component, you first need to install the package via npm or yarn. Run either of the following commands:

npm install @dailyy-app/react-native-image-zoom
yarn add @dailyy-app/react-native-image-zoom

๐Ÿšจ ๐Ÿšจ Please note that this library is built with React Native Reanimated v2 and uses React Native Gesture Handler. If you haven't installed Reanimated and Gesture Handler yet, please follow the installation instructions for Reanimated and Gesture Handler.

Usage

First, import the ImageZoom component from the @dailyy-app/react-native-image-zoom library:

import { ImageZoom } from '@dailyy-app/react-native-image-zoom';

To use the ImageZoom component, simply pass the uri prop with the URL of the image you want to zoom:

<ImageZoom uri={imageUri} />
<ImageZoom
  uri={imageUri}
  minScale={0.5}
  maxScale={3}
  onInteractionStart={() => console.log('Interaction started')}
  onInteractionEnd={() => console.log('Interaction ended')}
  onPinchStart={() => console.log('Pinch gesture started')}
  onPinchEnd={() => console.log('Pinch gesture ended')}
  onPanStart={() => console.log('Pan gesture started')}
  onPanEnd={() => console.log('Pan gesture ended')}
  renderLoader={() => <CustomLoader />}
  resizeMode="cover"
/>

Properties

All React Native Image Props &

| Property | Type | Default | Description | | ------------------ | -------- | ------------------- | ----------------------------------------------------------------------------------------------- | | uri | String | '' (empty string) | The image's URI, which can be overridden by the source prop. | | minScale | Number | 1 | The minimum scale allowed for zooming. | | maxScale | Number | 5 | The maximum scale allowed for zooming. | | minPanPointers | Number | 2 | The minimum number of pointers required to enable panning. | | maxPanPointers | Number | 2 | The maximum number of pointers required to enable panning. | | isPanEnabled | Boolean | true | Determines whether panning is enabled within the range of the minimum and maximum pan pointers. | | isPinchEnabled | Boolean | true | Determines whether pinching is enabled. | | onInteractionStart | Function | undefined | A callback triggered when the image interaction starts. | | onInteractionEnd | Function | undefined | A callback triggered when the image interaction ends. | | onPinchStart | Function | undefined | A callback triggered when the image pinching starts. | | onPinchEnd | Function | undefined | A callback triggered when the image pinching ends. | | onPanStart | Function | undefined | A callback triggered when the image panning starts. | | onPanEnd | Function | undefined | A callback triggered when the image panning ends. |

Changelog

Please refer to the Releases section on the GitHub repository. Each release includes a detailed list of changes made to the library, including bug fixes, new features, and any breaking changes. We recommend reviewing these changes before updating to a new version of the library to ensure a smooth transition.

Author

Support

If you need further assistance, feel free to reach out to me by email at @likashefi.

License

The library is licensed under the MIT License.