import{Dialog}from'react-native-simple-dialogs';<Dialogvisible={this.state.dialogVisible}title="Custom Dialog"onTouchOutside={()=>this.setState({dialogVisible: false})}><View>
// your content here
</View></Dialog>
Available props
Name
Type
Default
Description
visible
Boolean
false
Show the modal?
onRequestClose
Function
null
Callback that's called when users taps the hardware back button on Android
animationType
Enum('none', 'slide', 'fade')
'none'
Controls how the modal animates
onShow
Function
null
Callback that's called once the modal has been shown
onOrientationChange
Function
null
Callback that's called when the orientation change while the modal is being displayed on iOS
supportedOrientations
Array of Enum('portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right')
'portrait'
Allowed orientation while modals is being shown. More info at react-native docs
statusBarTranslucent
Boolean
null
Determines whether your modal should go under the system statusbar. More info at react-native docs
onTouchOutside
Function
null
Callbac that's called when users tap outside the shown modal
import{ConfirmDialog}from'react-native-simple-dialogs';// with message<ConfirmDialogtitle="Confirm Dialog"message="Are you sure about that?"visible={this.state.dialogVisible}onTouchOutside={()=>this.setState({dialogVisible: false})}positiveButton={{title: "YES",onPress: ()=>alert("Yes touched!")}}negativeButton={{title: "NO",onPress: ()=>alert("No touched!")}}/>// with custom content<ConfirmDialogtitle="Confirm Dialog"visible={this.state.dialogVisible}onTouchOutside={()=>this.setState({dialogVisible: false})}positiveButton={{title: "OK",onPress: ()=>alert("Ok touched!")}}><View>
// your content here
</View></ConfirmDialog>