0.6.3 • Published 3 years ago

@raulmax319/react-native-modal v0.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@raulmax319/react-native-modal

A fully animated and customizable rn-modal made using the animation library Reanimated v2. (project is still in W.I.P) critics and contributions are welcome.

Installation

Compatibility

Modal VersionRN Version
0.5.0>= 0.62

There are some checks before you start using this library.

  • Make sure the react-native version is at least 0.62+ as it uses the Hermes engine.
  • Have installed the library react-native-reanimated v2. You can do so by adding it to your project using the command: yarn add react-native-reanimated
  • Follow the installation steps for the reanimated v2 by following This link.
yarn add @raulmax319/react-native-modal

or with npm

npm install @raulmax319/react-native-modal

Example with useToggle hook

import Modal, { useToggle } from '@raulmax319/react-native-modal';

const ExampleComponent: React.FC = () => {
  // get the variables the name you want
  const [isModalVisible, toggleModal] = useToggle();

  const ExampleModal = () => (
    <Modal
      isVisible={isModalVisible}
      toggleModal={toggleModal}
      animationIn="ZoomIn"
      animationOut="SlideOutRight"
    >
      <View>
        <Text>HelloWorld!</Text>
      </View>
    </Modal>
  );

  return (
    <>
      {/*
      ...content
      */}
      <ExampleModal />
    </>
  );
};

Props

NameTypeDefault
isVisiblebooleanRequired
toggleModal( ) => voidRequired
animationInString'slideInUp'
animationOutString'slideOutDown'

Animations In list

  slideInUp,
  slideInDown,
  slideInLeft,
  slideInRight,
  zoomIn,

Animations Out list

  slideOutUp,
  slideOutDown,
  slideOutLeft,
  slideOutRight,
  zoomOut,

npm.io

TODO list

  • Add more animations.
  • Implement tests.
  • Implement Pan gesture for the swipe feature.
  • Add more props to make it more customizable.
  • refactor some prop names.
  • work on documentation.

Contributing

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

License

MIT

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago