Feature request: Support custom Ok button color in DialogService.Confirm via ConfirmOptions #1765

Closed
opened 2026-01-29 17:58:16 +00:00 by claunia · 3 comments
Owner

Originally created by @franklupo on GitHub (May 15, 2025).

Is your feature request related to a problem? Please describe.
I'm currently using DialogService.Confirm and I’d like to customize the ok button style. For example, when confirming a deletion, I’d like the button to be red (e.g., Colors.Danger). Currently, the button has a default style and does not allow customization of its color, which can be confusing or less intuitive for destructive actions.

Image

Describe the solution you'd like
I would like to extend ConfirmOptions to include an optional property that allows specifying the ok button color (e.g., string OkButtonColor). This way, developers can pass the desired color through DialogService.Confirm, improving UX and contextual clarity.

Describe alternatives you've considered

  • Manually creating a custom dialog for each case (which defeats the purpose of using DialogService.Confirm)
  • Adding custom CSS based on dialog title or content, but this is not maintainable or reliable.

Best regards

Originally created by @franklupo on GitHub (May 15, 2025). **Is your feature request related to a problem? Please describe.** I'm currently using `DialogService.Confirm` and I’d like to customize the ok button style. For example, when confirming a deletion, I’d like the button to be red (e.g., `Colors.Danger`). Currently, the button has a default style and does not allow customization of its color, which can be confusing or less intuitive for destructive actions. ![Image](https://github.com/user-attachments/assets/16bea729-67f4-47d5-b983-5766378c8706) **Describe the solution you'd like** I would like to extend `ConfirmOptions` to include an optional property that allows specifying the ok button color (e.g., string OkButtonColor). This way, developers can pass the desired color through `DialogService.Confirm`, improving UX and contextual clarity. **Describe alternatives you've considered** * Manually creating a custom dialog for each case (which defeats the purpose of using `DialogService.Confirm`) * Adding custom CSS based on dialog title or content, but this is not maintainable or reliable. Best regards
Author
Owner

@enchev commented on GitHub (May 19, 2025):

Not sure why "Adding custom CSS based on dialog title or content, but this is not maintainable or reliable." This is how our themes are built and how CSS works in general .

@enchev commented on GitHub (May 19, 2025): Not sure why "Adding custom CSS based on dialog title or content, but this is not maintainable or reliable." This is how our themes are built and how CSS works in general .
Author
Owner

@franklupo commented on GitHub (May 19, 2025):

Hi,
Example: I'm deleting a record on db I would like the confirmation button to be red to attract attention.

best regards

@franklupo commented on GitHub (May 19, 2025): Hi, Example: I'm deleting a record on db I would like the confirmation button to be red to attract attention. best regards
Author
Owner

@enchev commented on GitHub (May 19, 2025):

Use CSS to style the specific dialog in the way you need: https://forum.radzen.com/t/can-i-change-dialogs-content-css-for-only-one-dialog/14541/2?u=enchev

@enchev commented on GitHub (May 19, 2025): Use CSS to style the specific dialog in the way you need: https://forum.radzen.com/t/can-i-change-dialogs-content-css-for-only-one-dialog/14541/2?u=enchev
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1765