1.0.5 • Published 1 year ago

react-custom-confirm v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

react-custom-confirm

A React confrim modal with multiple theme, in place of javaScript inbuilt window.confirm()

NPM JavaScript Style Guide

Install

npm install react-custom-confirm

Screenshots

screenshot 1

screenshot 2

screenshot 3

screenshot 4

Mandatory porps

It takes 2 mandatory props: 1. show => boolean 2. setShow

Other Props:

  1. message => String
  2. handleProceed => function
  3. handleCancel => function
  4. type => string value => 'success' or 'warning' or 'info' or 'danger'
  5. confirmButtonText => String (default is Confirm)
  6. center => boolean => to align at center
  7. dark = boolean => to change modal backgroud to dark

Usage

import ConfirmModal from 'react-custom-confirm'
import 'react-custom-confirm/dist/index.css'

  const [show, setShow] = useState(false)


  const handleProceed  = () =>{
    console.log('Done')
    setShow(false)
  }

  const handleCancel = () =>{
    console.log('Cancelled')
    setShow(false)
  }

  const message = 'Example Message'


<ConfirmModal message={message} handleProceed={handleProceed} handleCancel={handleCancel} show={show} setShow={setShow} center={true} dark={true} type='danger'/>

License

MIT ©