Implementation of the Toastr Notifications in C# for Blazor via Interop
⚠️ Warning: This project is build on top of an experimental framework. There is a high propability that there will be breaking changes from version to version.
> dotnet add package Blazor.Toastr
OR
PM> Install-Package Blazor.Toastr
Nuget package & Release notes can be found here.
<script src="js/jquery-3.3.1.min.js"></script>
var serviceProvider = new BrowserServiceProvider(services =>
{
services.AddToastr();
});
OR
var serviceProvider = new BrowserServiceProvider(services =>
{
services.AddToastr(new ToastrOptions { closeButton = true, hideDuration = 3000 });
});
@using Blazor.Toastr
@inject IToastrService Toastr
void AnyMethod() {
Toastr.Show(Enums.ToastrType.Success, "This is a success message", "Title");
}