react-native-swipe-modal
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

react-native-swipe-modal

A Modal that supports transition from all directions.

Usage

Wrap root component in SwipeModalProvider

import {SwipeModalProvider} from 'react-native-swipe-modal';

In chlid component, where modal needs to be displayed, import useSwipeModal and call its show method to show modal

import {useSwipeModal} from 'react-native-swipe-modal';

const swipeModal = useSwipeModal();

swipeModal.show({ direction: 'top', renderChild: () => { return modalContent }, });

Other params of show

SwipeModalDirection = 'top' | 'right' | 'bottom' | 'left';

  • direction?: SwipeModalDirection;
  • allowBackDrop?: boolean;
  • autoHide?: boolean;
  • duration?: number;
  • renderChild: () => React.ReactElement;

Package Sidebar

Install

npm i react-native-swipe-modal

Weekly Downloads

6

Version

1.0.4

License

MIT

Unpacked Size

12.7 kB

Total Files

8

Last publish

Collaborators

  • khanshamshad