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-swippable-modal

v1.0.0

Published

A swippable modal using gesture handler and reanimated with customizable

Downloads

39

Readme

alt tag

react-native-swippable-modal


react-native-swippable-modal on npm react-native-swippable-modal downloads react-native-swippable-modal install size Android iOS MIT

This swippable modal library provides a swipe down modal close feature. Especially same modal contain textInput that too it worked well.

  • It also provides an example app and a detailed usage overview of swippable modal
  • It's fully Android and iOS compatible.

🎬 Preview


| Example | | :-------------------------------------: | | alt tag |

Installation

1. Install swippable modal
$ npm install react-native-swippable-modal
# --- or ---
$ yarn add react-native-swippable-modal
2. Install required dependencies
$ npm install react-native-reanimated react-native-gesture-handler
# --- or ---
$ yarn add react-native-reanimated react-native-gesture-handler
3. Install cocoapods in the ios project
cd ios && pod install

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

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

Usage


import React, { createRef } from 'react';
import { Button, Image, TextInput, View } from 'react-native';
import {
  SwippableModal,
  SwippableModalRefType,
} from 'react-native-swippable-modal';

const exampleModalRef = createRef<SwippableModalRefType>();

const App = () => {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Button
        title="Open Modal"
        onPress={() => exampleModalRef.current?.show()}
      />
      <SwippableModal ref={exampleModalRef} closeThreadSoldValue={100}>
        <TextInput placeholder={'Example Input'} />
        <View style={{ height: 150, width: '100%', marginTop: 10 }}>
          <Image
            source={{
              uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/800px-Image_created_with_a_mobile_phone.png',
            }}
            style={{ width: '100%', height: '100%' }}
            resizeMode={'contain'}
          />
        </View>
      </SwippableModal>
    </View>
  );
};

export default App;

Properties


| Props | Default | Type | Description | | :---------------------------------------- | :-------- | :-------------------- | :--------------------------------------------------------- | | ref* | modalRef | reference | It is default reference to open modal | | children | - | ReactNode | Pass children as ReactNode (Custom UI) | | closeThreadSoldValue | 200 | number | It's take number value from where point modal will closed | | modalStyle | - | ViewStyle | Modal style | | modalBackgroundColor | #FAFAFA | {backgroundColor: string}| Change modal background color | | disableLine | false | boolean | It's used for disable line (Hide line) | | modalInnerContainerStyle | - | ViewStyle | Modal inner container style | | disableClose | false | boolean | If true, modal will not close if touch out side the modal (only swipe down close allow) | | disableBackgroundColor | false | boolean | If pass true, it will change background color #FFFFFF04 | | disableSwipeDown | false | boolean | If true, it will disable gesture swipe down close | | panGestureProps | {} | PanGestureHandlerProp | Pan Gesture Props | | modalContainerStyle | - | ViewStyle | Modal Container style | | modalLineStyle | - | ViewStyle | Modal Line style | | showModal | - | function | Default function to open modal | | hideModal | - | function | Default function to hide modal | | panRef | panRef | reference | Default pan reference to get pan gesture references values |

Example

A full working example project is here Example

  • Install dependencies in example app cd example && yarn && cd ios/ && pod install && cd ..
  • Run example app yarn ios

Find this library useful? ❤️

Support it by joining stargazers for this repository.⭐

🤝 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.

Bugs / Feature requests / Feedbacks

For bugs, feature requests, and discussion please use GitHub Issues

License