Satish Baghel
Satish Baghel

Reputation: 55

how to change size of button in sweet alert

How can I change the size of button in sweet alert.

Screen like

The code is:

swal({
      title: `Are you sure to delete this news posted by ${news.users.user_name} ?`,
      text: `Once deleted, you will not be able to recover this post!`,
      icon: "warning",
      buttons: true,
      dangerMode: true,
    }).then(willDelete => {
      if (willDelete) {
        this.props.deleteNewsPosts(news._id)
      } else {
        swal(`This news is safe!`)
      }
    })
  } 

Upvotes: 2

Views: 7978

Answers (1)

Ran Marciano
Ran Marciano

Reputation: 1531

Try using CSS on the .swal-button class (if you want it to be more specific you can pass a classname property to that alert or to the buttons as described here: https://sweetalert.js.org/docs/#configuration)

Upvotes: 2

Related Questions