Skip to content

Modal

Modal presents content in a focused overlay, blocking interaction with the underlying page. Use for confirmations, forms, or important decisions.


<Modal
visible={isOpen}
onClose={() => setIsOpen(false)}
title="Modal Title"
>
<Text>Modal content goes here.</Text>
</Modal>

sm
md
lg
<Modal size="sm" visible={isOpen} onClose={handleClose} title="Small">...</Modal>
<Modal size="md" visible={isOpen} onClose={handleClose} title="Medium">...</Modal>
<Modal size="lg" visible={isOpen} onClose={handleClose} title="Large">...</Modal>

<Modal
visible={isOpen}
onClose={handleClose}
title="Save Reading"
footer={
<View style={styles.footer}>
<Button variant="secondary" onPress={handleDiscard}>Discard</Button>
<Button onPress={handleSave}>Save</Button>
</View>
}
>
<Text>Do you want to save this reading?</Text>
</Modal>

Pre-built confirmation dialog.

<ConfirmModal
visible={showConfirm}
onClose={() => setShowConfirm(false)}
onConfirm={handleDelete}
title="Delete Reading?"
message="This action cannot be undone."
confirmText="Delete"
destructive
/>

PropTypeDefaultDescription
visiblebooleanRequiredWhether visible
onClose() => voidRequiredClose handler
titlestring-Modal title
size'sm' | 'md' | 'lg' | 'full''md'Modal size
closeOnBackdropbooleantrueClose on backdrop press
showCloseButtonbooleantrueShow close button
childrenReactNodeRequiredModal content
footerReactNode-Footer content
styleViewStyle-Custom styles
PropTypeDefaultDescription
visiblebooleanRequiredWhether visible
onClose() => voidRequiredClose handler
onConfirm() => voidRequiredConfirm handler
titlestringRequiredDialog title
messagestringRequiredDialog message
cancelTextstring'Cancel'Cancel button text
confirmTextstring'Confirm'Confirm button text
destructivebooleanfalseDestructive action