GA-MO / react-confirm-alert

react component confirm dialog.
https://ga-mo.github.io/react-confirm-alert/demo/
MIT License
272 stars 105 forks source link

How to add custom class in confirmation box? #10

Closed Hardik21 closed 6 years ago

GA-MO commented 6 years ago

@Hardik21

The default UI for normal use case just call the function it.

Using the customUI to make your own confirmation box.

confirmAlert({
  customUI: ({ onClose }) => {
    return (
      <div className='custom-ui'>
        <h1>Are you sure?</h1>
        <p>You want to delete this file?</p>
        <button onClick={onClose}>No</button>
        <button onClick={() => {
            this.handleClickDelete()
            onClose()
        }}>Yes, Delete it!</button>
      </div>
    )
  }
})