Skip to content

A react native library, provides a Modal that supports transition from all direction with swipe to close it.

License

Notifications You must be signed in to change notification settings

khanshamshad32/react-native-swipe-modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

A react native library, provides a Modal that supports transition from all direction with swipe to close it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published