Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

71 Commits

Repository files navigation

react-native-modalbox

A react native component, easy, fully customizable, implementing the 'swipe down to close' feature.

Preview

Install

npm install react-native-modalbox@latest --save

Example

Check index.js in the Example folder.

Properties

PropDefaultTypeDescription
isOpenfalseboolOpen/close the modal, optional, you can use the open/close methods instead
isDisabledfalseboolDisable any action on the modal (open, close, swipe)
backdropPressToClosetrueboolClose the the modal by pressing on the backdrop
swipeToClosetrueboolSet to true to enable the swipe down to close feature
swipeThreshold50numberThe threshold to reach in pixels to close the modal
swipeArea-numberThe height in pixels of the swipeable area, window height by default
positioncenterstringControl the modal position using top or center or bottom
backdroptrueboolDisplay a backdrop behind the modal
backdropOpacity0.5boolOpacity of the backdrop
backdropColorblackboolbackgroundColor of the backdrop
backdropContentnullReactElementAdd an element in the backdrop (a close button for example)
animationDuration400numberDuration of the animation

Events

PropParamsDescription
onClosed-When the modal is close and the animation is done
onOpened-When the modal is open and the animation is done
onClosingStatestate boolWhen the state of the swipe to close feature has changed (usefull to change the content of the modal, display a message for example)

Methods

These methods are optional, you can use the isOpen property instead

PropParamsDescription
open-Open the modal
close-Close the modal

About

A <Modal/> component for react-native

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages