To achieve this, you can use several CSS rules.
Since the buttons are aligned using flexbox, we can rewrite some of these css rules to be able to include three buttons in a modal instead of two. First, note that I have added custom css ( custom-alert ) code to the warning, so our CSS rules will only affect this warning:
let alert = this.alertCtrl.create({ cssClass: 'custom-alert', ... });
And then:
.custom-alert button.alert-button-group { width: 33.33%; } .custom-alert .alert-button-group .button-inner { -webkit-box-pack: center; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; } .custom-alert .alert-button-group-vertical { -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row ; }
The magic is done by setting the width to 33.33% to allow the buttons to fit on the same line, and then adding flex-direction: row to the container instead of the default column value (so the buttons appear in the column in your screenshot).
source share