Completed
Last Updated: 02 Jul 2024 13:45 by Al
Al
Created on: 25 Jun 2024 21:16
Category: UI for Blazor
Type: Feature Request
1
TelerikNotification MarkupString HTML Multiline
Request the TelerikNotification supports MarkupString or HTML or at least Multiline text
2 comments
Al
Posted on: 02 Jul 2024 13:45
Thank you. I would request that the documentation be updated to show this clearly. 
ADMIN
Hristian Stefanov
Posted on: 02 Jul 2024 09:13

Hi Al,

I confirm that it is already possible to use MarkupString or HTML within the TelerikNotification. To achieve this, utilize the Notification Template. Here is an example:

<TelerikButton OnClick="@AddNotification">Open a notification</TelerikButton>

<TelerikNotification VerticalPosition="@NotificationVerticalPosition.Top" @ref="@NotificationReference" Class="MyTelerikNotification">
    <Template>
        @{
            var item = context.Text;
            @((MarkupString)item.Replace("\n", "<br />"))
        }
    </Template>
</TelerikNotification>

@code {
    public TelerikNotification NotificationReference { get; set; }

    string message = "Firstline\n" + "Secondline\n" + "Thirdline\n";

    public void AddNotification()
    {
        NotificationReference.Show(new NotificationModel()
            {
                Text = message,
                ThemeColor = "primary"
            });
    }
}

<style>
    .MyTelerikNotification .k-notification-container .k-notification-wrap {
        width: 300px;
        height: 150px;
        font-size: 1.5em;
        text-align: center;
        align-items: center;
    }
</style>

Therefore, I'm marking this as "Completed".

Regards,
Hristian Stefanov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!