Modal
Usage
Open Modal
function ModalUsage() {
const [showModal, setShowModal] = useState(false)
return (
<View>
<Button onPress={() => setShowModal(true)}>Open Modal</Button>
<Modal visible={showModal} onBackdropPress={() => setShowModal(false)}>
<ModalContent
title="Hello world"
description="Lorem ipsum"
actionButtons={[
{
title: 'Cancel',
onPress: () => setShowModal(false),
},
{
title: 'Done',
onPress: () => setShowModal(false),
},
]}
/>
</Modal>
</View>
)
}
Props
Prop | Data Type | Default Value | Description |
---|---|---|---|
Extends | ModalProps$1 | -- | Inherits properties from ModalProps$1 |
onBackdropPress | () => void | -- | -- |
backdropStyle | StyleProp<ViewStyle> | -- | -- |
contentStyle | StyleProp<ViewStyle> | -- | -- |