Skip to main content

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

PropData TypeDefault ValueDescription
ExtendsModalProps$1--Inherits properties from ModalProps$1
onBackdropPress() => void----
backdropStyleStyleProp<ViewStyle>----
contentStyleStyleProp<ViewStyle>----