@acodez/modal
React modal component.
Installation
npm install @acodez/modal
Props API
Property | Type | Required | Description |
---|
actionBtnText | string | no | Action button text, default - show modal |
cancelBtnText | string | no | Cancel button text, default - Cancel |
saveBtnText | string | no | Save button text, button will be hidden if no value entered |
saveBtnFunction | string | no | save button function |
showCloseBtn | string | no | show close button on modal or not |
disableBgClose | string | no | if you want to limit closing of modal to button click |
Usage
import Modal from "@acodez/modal";
Basic
<Modal>
<p>
Modal content here.
</p>
</Modal>
Advanced
<Modal disableBgClose showCloseBtn saveBtnFunction={saveFunction} actionBtnText="open modal" saveBtnText="Save" cancelBtnText="Cancel" modalHeading="This is modal heading">
<p>
To close this modal, press the cancel button below or use the Escape key on desktop.
</p>
</Modal>