Articles in this section
Category / Section

How to Add the Line Breaks in Blazor Predefined Dialog?

1 min read

To add a line break in a predefined alert Blazor Dialog, utilize the DialogOptions.ChildContent property. This allows loading custom content, including line breaks, in the alert dialog. Below is a code snippet demonstrating how to implement this:

private async Task AlertBtn()
{
    await DialogService.AlertAsync(null, "Low Battery", new DialogOptions()
    {
        ChildContent = @<span>10% of battery remaining<br/><br/>Please charge your device</span>
    });

    this.DialogStatus = "The user closed the Alert dialog";
}

image.png

Additional References

Conclusion
We hope you enjoyed learning how to add the line breaks in Blazor predefined Dialog.
You can refer to our Blazor Dialog feature tour page to know about its other groundbreaking features, documentation, and how to quickly get started with configuration specifications. You can also explore our Blazor Dialog example to understand how to create and manipulate data.
For current customers, our Blazor components are available on the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to evaluate our Blazor Dialog and other Blazor components.
If you have any questions or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

PredefinedDialog.zip
Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied