Skip to main content

Alert-Modal

Basic

Let's say you want to create a simple Alert-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 [confirmModalOpen, setConfirmModalOpen] = useState(false);

For onCancle event developer have to create one funtion, just like :

const handleCancle = () => {setConfirmModalOpen(false);};
<ConfirmModal
isVisible={confirmModalOpen}
onConfirm={() => alert('confirmed')}
onCancel={handleCancle}
/>

The above code will render Time like this.

Basic Modal

Props

NameTypeRequiredDescription
isVisiblebooleanYesFor visible to the user

Events

NameTypeRequiredDescription
onConfirm() => voidYesThe onConfirm event For take a confirmation from user
onCancel() => voidYesThe onCancel event For take a confirmation from user