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
| # | Name | Data type | Default value | Values | Description |
|---|---|---|---|---|---|
| 1 | visible | boolean | false | true , false | Determines Whether the modal is visible. |
| 2 | dismissible | boolean | true | true , false | Determines whether clicking outside the modal dismiss it. |
| 3 | dismissableBackButton | boolean | dismissable | Determines whether clicking Android hardware back button dismisses the dialog. | |
| 4 | onDismiss | Callback that is called when the user dismisses the modal. | |||
| 5 | contentContainerStyle | Style for the content of the modal . |
For more details https://callstack.github.io/react-native-paper/docs/components/Modal