Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.
/ react-simplert Public archive

NOT MAINTAINED ⚠️ ReactJS Simple Alert Component (SweetAlert Inspired)

License

Notifications You must be signed in to change notification settings

mazipan/react-simplert

Repository files navigation

react-simplert

License Github Issue GitHub Fork GitHub Star

version downloads monthly downloads

react-simplert

ReactJS Simple Alert Component (SweetAlert Inspired)

Demo

https://mazipan.github.io/react-simplert/

Download

npm install react-simplert
OR
yarn add react-simplert

How to Use

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.

Available Props

{
  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 :

Email Website Facebook

Twitter Linkedin Slideshare