1.0.1 ā€¢ Published 1 year ago

modal-swipe-up v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

modal-swipe-up

modal-swipe-up is a swipeable, easy to use Modal for your React Native projects. You can close the modal by swiping up with pan gestures. Feel free to redesign inside of the Modal.

āš™ļø Installation

To install the package;

$ npm i modal-swipe-up

āœ… It is done!

šŸš€ How to use

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

import ModalSwipeUp from 'modal-swipe-up';

export default App = () => {
  const [modalProps, setModalProps] = useState({
   // ...or any prop you want
  });
  const [isModalActive, setIsModalActive] = useState(false);

  const closeModal = () => {
    setIsModalActive(false);
  };

  return (
    <View style={styles.container}>
      <Text style={styles.welcome}>Welcome to React Native!</Text>
      <Text style={styles.instructions}>To get started, edit App.js</Text>
        <ModalSwipeUp showModal={isModalActive} 
          onPressClose={closeModal}
          closeHeight={200}>
        <PanelContent /> {/* Your Content Here */}
       </ModalSwipeUp>
    </View>
  );
};

ā˜ļø Options

PropertiesTypeDescriptionDefault
showModalboolShow/Hide the modalfalse
onPressCloseFunctionFired when the modal is closed
closeHeightnumberSet minimum height for swipe up and close modal
onOpenFunctionFired when the modal is opened

ā­ļø Show Your Support

Please give a ā­ļø if this project helped you!

šŸ‘ Contributing

If you have any questions or requests or want to contribute to modal-swipe-upl, please write the issue or give me a Pull Request freely.