Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Toast message with multiple lines #1097

Unanswered
roysurles asked this question in Q&A
Discussion options

Is it possible to create a toast message with multiple lines?

"Message1
Message2" renders single line instead of 2 lines

You must be logged in to vote

Replies: 1 comment

Comment options

@roysurles Use "Toast with templated content".

Example

<Toasts class="p-3" Messages="messages" />
<Button Class="btn btn-primary" @onclick="ShowToast">Toast with Content</Button>
@code {
 List<ToastMessage> messages = [];
 private void ShowToast() =>
 messages.Add(
 new ToastMessage
 {
 Type = ToastType.Info,
 Title = "Blazor Bootstrap",
 Content = @<div>Hello, world! This is a toast message. <br /> Add additional information here.</div>,
 });
}

Screenshot

image

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #1093 on April 20, 2025 15:47.

AltStyle によって変換されたページ (->オリジナル) /