Skip to main content

Simple-Modal

Basic

Let's say you want to create a simple Simple-Modal. So let's take an example how you do it, check it out below.

For model developer have to create state, just like :

const [isModalOpen, setIsModalOpen] = useState(false);

For onClose And onBackDrop event developer have to create two funtion, just like :

const handleClose = () => {setIsModalOpen(false);};
const handleBackdrop = () => {setIsModalOpen(false);};
<Modal
containerStyle={{ maxWidth: 1000 }}
isVisible={isModalOpen}
title="Modal Title"
onClose={handleClose}
onBackDrop={handleBackdrop}>
<h4>Hello world!! THis is Modal </h4>
<h4>Hello world!! THis is Modal </h4>
<h4>Hello world!! THis is Modal </h4>
<h4>Hello world!! THis is Modal </h4>
</Modal>

The above code will render Time like this.

Basic Modal

Props

NameTypeRequiredDescription
isVisiblebooleanYesname of a input.
titlestringYesTitle of modal
childrenReact.ReactNodeYes------
containerStyleCSSPropertiesNo------
headerStyleCSSPropertiesNo------
backdropStyleCSSPropertiesNo------
headerIconstringNo------

Events

NameTypeRequiredDescription
onClose() => voidYesTo close the modal
onBackDrop() => voidNo------