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-reanimated-zoom

v0.3.3

Published

Component to add zoom in react native views.

Downloads

85,832

Readme

react-native-reanimated-zoom 🔎

Component for zooming react native views. 🧐

https://user-images.githubusercontent.com/23293248/155864802-a81cf3a3-9f08-4399-abee-64bc94049c8b.mp4

Features

  • Simple API.
  • Performant. No state triggered re-renders. ⚡️
  • Can be used with Image/Video or any kind of View.
  • Works with FlatList/ScrollView.
  • Consistent on Android and iOS.

https://user-images.githubusercontent.com/23293248/174450283-e05684ed-9963-448b-8efc-bf33973aae0a.MP4

Installation

# npm
npm install react-native-reanimated-zoom
# yarn
yarn add react-native-reanimated-zoom

Peer dependencies

Make sure you have installed react-native-gesture-handler > 2 and react-native-reanimated > 2.

Usage

Simple zoom view

import { Zoom } from 'react-native-reanimated-zoom';

export default function App() {
  return (
    <Zoom>
      <Image
        source={{
          uri: 'your image uri',
        }}
        style={{ width: 300, height: 400 }}
      />
    </Zoom>
  );
}

With FlatList or ScrollView

import { FlatList } from 'react-native';
import { Zoom, createZoomListComponent } from 'react-native-reanimated-zoom';

const ZoomFlatList = createZoomListComponent(FlatList);

const ListExample = () => {
  const renderItem = React.useCallback(
    ({ item }) => {
      return (
        <Zoom>
          <Image
            source={{
              uri: item,
            }}
            style={{
              width: 400,
              height: 400,
            }}
          />
        </Zoom>
      );
    },
    [dimension]
  );

  return (
    <ZoomFlatList
      data={data}
      pagingEnabled
      horizontal
      keyExtractor={(item) => item}
      renderItem={renderItem}
    />
  );
};

Props

  • minimumZoomScale - Determines minimum scale value the component should zoom out. Defaults to 1.
  • maximumZoomScale - Determines maximum scale value the component should zoom in. Defaults to 8.
  • onZoomBegin - Callback. Gets called when view is zoomed in.
  • onZoomEnd - Callback. Gets called when view zoom is restored.

Examples

  • You can find examples of a simple zoom view and zoomable items in list here

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Known issues

  • https://github.com/software-mansion/react-native-gesture-handler/issues/1804#issuecomment-1019819191 Currently pan and pinch gesture are not triggering simultaneously in expo managed workflow. I'll look into it when I have some time. This issue doesn't happen on bare react native, release or expo dev client builds.

Credits

Built with react-native-builder-bob ❤️