@@ -14,8 +14,8 @@ Just click on ⭐️ button 😘
14
14
<br >
15
15
<!--  -->
16
16
<span >
17
- <img src =" https://raw.githubusercontent.com/jacklam718/react-native-modals/master/.github/fade-animation .gif " width =" 220 " >  ;  ;
18
- <img src =" https://raw.githubusercontent.com/jacklam718/react-native-modals/master/.github/scale-animation .gif " width =" 220 " >  ;  ;
17
+ <img src =" https://raw.githubusercontent.com/jacklam718/react-native-modals/master/.github/swipeable-modal .gif " width =" 220 " >  ;  ;
18
+ <img src =" https://raw.githubusercontent.com/jacklam718/react-native-modals/master/.github/bottom-modal .gif " width =" 220 " >  ;  ;
19
19
<img src =" https://raw.githubusercontent.com/jacklam718/react-native-modals/master/.github/slide-animation.gif " width =" 220 " >
20
20
</span >
21
21
@@ -33,6 +33,7 @@ yarn add react-native-modals
33
33
## Exposed Modules
34
34
35
35
* Modal
36
+ * BottomModal
36
37
* Backdrop
37
38
* ModalButton
38
39
* ModalContent
@@ -42,6 +43,8 @@ yarn add react-native-modals
42
43
* FadeAnimation
43
44
* ScaleAnimation
44
45
* SlideAnimation
46
+ * DragEvent,
47
+ * SwipeDirection,
45
48
* ModalProps
46
49
* ModalFooterProps
47
50
* ModalButtonProps
@@ -96,6 +99,27 @@ import Modal, { SlideAnimation, ModalContent } from 'react-native-modals';
96
99
< / View>
97
100
```
98
101
102
+ ## Usage - Swipe
103
+ ``` jsx
104
+ import Modal , { ModalContent } from ' react-native-modals' ;
105
+ import { Button } from ' react-native'
106
+
107
+ < View style= {styles .container }>
108
+ < Modal
109
+ visible= {this .state .visible }
110
+ swipeDirection= {[' up' , ' down' ]} // can be string or an array
111
+ swipeThreshold= {200 } // default 100
112
+ onSwipeOut= {(event ) => {
113
+ this .setState ({ visible: false });
114
+ }}
115
+ >
116
+ < ModalContent>
117
+ {... }
118
+ < / ModalContent>
119
+ < / Modal>
120
+ < / View>
121
+ ```
122
+
99
123
## Usage - Modal Title
100
124
``` jsx
101
125
import Modal , { ModalTitle , ModalContent } from ' react-native-modals' ;
@@ -164,9 +188,15 @@ import Modal, { ModalFooter, ModalButton, ModalContent } from 'react-native-moda
164
188
| ` onDismiss? ` | ` Function ` | | You can pass onDismiss function as a callback function, will call the function when modal dismissed | |
165
189
| ` onTouchOutside? ` | ` Function ` | ` () => {} ` | | |
166
190
| ` onHardwareBackPress? ` | ` Function ` | ` () => true ` | [ Handle hardware button presses] ( https://facebook.github.io/react-native/docs/backhandler ) | |
191
+ | ` onMove? ` | ` Function ` | ` () => {} ` | | |
192
+ | ` onSwiping? ` | ` Function ` | ` () => {} ` | | |
193
+ | ` onSwipeRelease? ` | ` Function ` | ` () => {} ` | | |
194
+ | ` onSwipingOut? ` | ` Function ` | ` () => {} ` | | |
195
+ | ` onSwipeOut? ` | ` Function ` | | | |
196
+ | ` swipeDirection? ` | ` string or Array<string> ` | [ ] | Available option: ` up ` , ` down ` , ` left ` , ` right ` | |
197
+ | ` swipeThreshold? ` | ` number ` | ` 100 ` | | |
167
198
| ` footer? ` | ` React Element ` | ` null ` | for example: ``` <View><Button text="DISMISS" align="center" onPress={() => {}}/></View> ``` | |
168
199
169
-
170
200
### ModalTitle
171
201
| Prop | Type | Default | Note |
172
202
| ---| ---| ---| ---|
0 commit comments