2.0.2 • Published 4 years ago

react-native-modalbox v2.0.2

Weekly downloads
12,820
License
MIT
Repository
github
Last release
4 years ago

react-native-modalbox

npm npm

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

Wanna implement IAP in your beautiful modal? 👇

Preview

npm.io npm.io

Install

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

Example

Check index.js in the Example folder.

Version note

react-nativereact-native-modalbox
<= 0.57<= 1.6.0
>= 0.58>= 1.6.1

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
entrybottomstringControl the modal entry position top or bottom
backdroptrueboolDisplay a backdrop behind the modal
backdropOpacity0.5numberOpacity of the backdrop
backdropColorblackstringbackgroundColor of the backdrop
backdropContentnullReactElementAdd an element in the backdrop (a close button for example)
animationDuration400numberDuration of the animation
easingEasing.elastic(0.8)functionEasing function applied to opening modal animation
backButtonClosefalsebool(Android only) Close modal when receiving back button event
startOpenfalseboolAllow modal to appear open without animation upon first mount
coverScreenfalseboolWill use RN Modal component to cover the entire screen wherever the modal is mounted in the component hierarchy
keyboardTopOffsetios:22, android:0numberThis property prevent the modal to cover the ios status bar when the modal is scrolling up because the keyboard is opening
useNativeDrivertrueboolEnables the hardware acceleration to animate the modal. Please note that enabling this can cause some flashes in a weird way when animating

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
react-native-voicify-assistant@infinitebrahmanuniverse/nolb-react-native-mo@everything-registry/sub-chunk-2584ideiaapp-storiesexpress-torus-react-nativeexpo-insta-storyexpo-hamro-image-pickerexpo-stories-interactivehyeonmininso-motorbike-liability@fbcmobile/uipcmli.umbrella.react-nativelastmile-ui-mapboxmanuscriptjsmrmcm-uiminiappluxstayrnquec-panel-templatecitizenship_app_newschinesefood@anasps/react-native-formuc-rn-v2-sharedreact-native-chapo-story-instareact-native-fb-storyreact-native-flutterwavereact-native-flutterwave-paymentreact-native-form-idablereact-native-easy-commentsreact-native-easy-address-pickerreact-native-baseitem-laihuihuangreact-native-formikreact-native-increibles-alertasreact-native-insta-storyreact-native-insta-story-2react-native-instastory-imagereact-native-video-insta-storyshowpascorpiousscorpious_kogosakurasattvareact-calendar-animationreact-native-responsive-app-modalreact-native-rg-storyreact-native-1appreact-native-1app-themereact-native-chunkyreact-native-number-password-boxreact-native-minuitreact-native-js-bottom-sheetreact-native-my-storiesreact-native-stories-bynreact-native-stories-festoreact-native-stories-instagramreact-native-stories-mediareact-native-stories-media-srireact-native-stories-srireact-native-story-componentreact-native-stories-media_modreact-native-stories-plusreact-native-teesta-storyreact-native-sheetmenureact-native-qiscus-sdkreact-native-livechat-customreact-native-liveplayerrn-codemi-learningrn-insta-storiesrn-insta-story@brunoccpires/fixed-stories-focalweb@dooboo-ui/alert-dialog@metehankurucu/react-native-insta-story@liquide/react-native-stories@sasikotha/audiocomponentwarpie-react-nativewallet-app@janbox/rn-ui@tickid/tickid-radazippi-market-core@itswooble/react-native-insta-story@voicify/react-native-voicify-assistant
2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.12

7 years ago

1.3.11

7 years ago

1.3.10

7 years ago

1.3.9

7 years ago

1.3.8

8 years ago

1.3.7

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago