Swapping the Order of Buttons on Confirm Dialog

Hi Team,

Been a while, but I have another project that uses Radzen UI. Congrats on v12, looking real good.

Quick question, just to make sure I’m not missing anything, before I go and make a custom dialog.

I’ve added some Yes/No confirm dialogs to the app I’m working on, and the stake-holders have stated “We prefer the Call to Action Button, on the Right”, is there a way I can swap the order of the Yes no buttons?

Cheers

Shawty

Yes, with CSS only. The confirm dialog buttons are in a flex container, so reversing the direction swaps them:

.rz-dialog-confirm-buttons {
    flex-direction: row-reverse;
}

To apply it only to specific dialogs, set CssClass in ConfirmOptions and scope the rule:

await DialogService.Confirm("Are you sure?", "Delete",
    new ConfirmOptions { OkButtonText = "Yes", CancelButtonText = "No", CssClass = "cta-right" });
.cta-right .rz-dialog-confirm-buttons {
    flex-direction: row-reverse;
}

Note that this is visual only - the Tab order stays Yes, then No.

Thanks Enchev,

Tab order isn’t important, just that the stake holders want the Yes on the right visibly.

Cheers

Shawty