Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-swipe-modal

khanshamshad3228MIT1.0.4TypeScript support: included

A react native library, provides a Modal that supports transition from all directions

react, react native, modal, swipe modal, animated modal

readme

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;