Skip to main content

Modal

The Modal component is a basic way to present content above an Main screen. To render the Modal above other components, you'll need to wrap it with the Portal component.

How to use

import React from 'react';
import { Modal, Portal, Text,} from '@gyri/native-ui-components';

const MyComponent = ({visible,onDismiss}) => {
return (
<Portal>
<Modal visible={visible} onDismiss={hideModal}>
<Text>Example Modal.</Text>
</Modal>
</Portal>
);
};

export default MyComponent;

Props

#NameData typeDefault valueValuesDescription
1visiblebooleanfalsetrue , falseDetermines Whether the modal is visible.
2dismissiblebooleantruetrue , falseDetermines whether clicking outside the modal dismiss it.
3dismissableBackButtonbooleandismissableDetermines whether clicking Android hardware back button dismisses the dialog.
4onDismissCallback that is called when the user dismisses the modal.
5contentContainerStyleStyle for the content of the modal .

For more details https://callstack.github.io/react-native-paper/docs/components/Modal