ReactJS Simple Alert Component (SweetAlert Inspired)
https://mazipan.github.io/react-simplert/
npm install react-simplert
OR
yarn add react-simplert
Import to your component :
import Simplert from 'react-simplert'Create some template in render() :
<Simplert
showSimplert={ this.state.showAlert }
type={ this.state.typeAlert }
title={ this.state.titleAlert }
message={ this.state.messageAlert }
/>Just set the props with your custom state.
{
showSimplert: PropTypes.bool.isRequired,
title: PropTypes.string,
message: PropTypes.any,
type: PropTypes.string,
customClass: PropTypes.string,
customIconUrl: PropTypes.string,
onOpen: PropTypes.func,
customCloseBtnText: PropTypes.string,
customCloseBtnClass: PropTypes.string,
onClose: PropTypes.func,
onOverlayClose: PropTypes.func,
useConfirmBtn: PropTypes.bool,
customConfirmBtnText: PropTypes.string,
customConfirmBtnClass: PropTypes.string,
onConfirm: PropTypes.func,
disableOverlayClick: PropTypes.bool,
hideAllButton: PropTypes.bool
}Note: If onClose is provided but onOverlayClose is not, onClose will be called when the Simplert is closed via the overlay.
Hope will usefull for you all.
Contact Me :
