Blazored.Toast 1.0.0

A JavaScript free Toast library for Blazor and Razor Components applications.

There is a newer version of this package available.
See the version list below for details.
Install-Package Blazored.Toast -Version 1.0.0
dotnet add package Blazored.Toast --version 1.0.0
<PackageReference Include="Blazored.Toast" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazored.Toast --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Blazored Toast

This is a JavaScript free toast implementation for Blazor and Razor Components application.

Getting Setup

You can install the package via the NuGet package manager just search for Blazored.Toast. You can also install via PowerShell using the following command.

Install-Package Blazored.Toast

Or via the dotnet CLI.

dotnet add package Blazored.Toast

1. Register Services

First, you will need to add the following line to your applications Startup.ConfigureServices method.

public void ConfigureServices(IServiceCollection services)
{
    services.AddBlazoredToast();
}

2. Add Imports

Second, add the following to your _ViewImports.cshtml

@using Blazored
@using Blazored.Toast.Services

@addTagHelper *, Blazored.Toast

3. Register Toasts Component

Third and finally you will need to register the &lt;Toasts /&gt; component in your applications MainLayout.cshtml.

Usage

In order to show a toast, you have to inject the IToastService into the component or service you want to trigger a toast. You can then call the ShowToast method passing in the toast level you require along with the message to display and an optional heading.

@page "/toastdemo"
@inject IToastService toastService

<h1>Toast Demo</h1>

To show a toast just click one of the buttons below.

<button class="btn btn-info" onclick="@(() => toastService.ShowToast(ToastLevel.Info, "I'm an INFO message"))">Info Toast</button>
<button class="btn btn-success" onclick="@(() => toastService.ShowToast(ToastLevel.Success, "I'm a SUCCESS message with a custom title", "Congratulations!"))">Success Toast</button>
<button class="btn btn-warning" onclick="@(() => toastService.ShowToast(ToastLevel.Warning, "I'm a WARNING message"))">Warning Toast</button>
<button class="btn btn-danger" onclick="@(() => toastService.ShowToast(ToastLevel.Error, "I'm an ERROR message"))">Error Toast</button>

Blazored Toast

This is a JavaScript free toast implementation for Blazor and Razor Components application.

Getting Setup

You can install the package via the NuGet package manager just search for Blazored.Toast. You can also install via PowerShell using the following command.

Install-Package Blazored.Toast

Or via the dotnet CLI.

dotnet add package Blazored.Toast

1. Register Services

First, you will need to add the following line to your applications Startup.ConfigureServices method.

public void ConfigureServices(IServiceCollection services)
{
    services.AddBlazoredToast();
}

2. Add Imports

Second, add the following to your _ViewImports.cshtml

@using Blazored
@using Blazored.Toast.Services

@addTagHelper *, Blazored.Toast

3. Register Toasts Component

Third and finally you will need to register the &lt;Toasts /&gt; component in your applications MainLayout.cshtml.

Usage

In order to show a toast, you have to inject the IToastService into the component or service you want to trigger a toast. You can then call the ShowToast method passing in the toast level you require along with the message to display and an optional heading.

@page "/toastdemo"
@inject IToastService toastService

<h1>Toast Demo</h1>

To show a toast just click one of the buttons below.

<button class="btn btn-info" onclick="@(() => toastService.ShowToast(ToastLevel.Info, "I'm an INFO message"))">Info Toast</button>
<button class="btn btn-success" onclick="@(() => toastService.ShowToast(ToastLevel.Success, "I'm a SUCCESS message with a custom title", "Congratulations!"))">Success Toast</button>
<button class="btn btn-warning" onclick="@(() => toastService.ShowToast(ToastLevel.Warning, "I'm a WARNING message"))">Warning Toast</button>
<button class="btn btn-danger" onclick="@(() => toastService.ShowToast(ToastLevel.Error, "I'm an ERROR message"))">Error Toast</button>

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.6 84 9/17/2019
2.0.5 208 9/5/2019
2.0.4 240 8/13/2019
2.0.3 609 7/25/2019
2.0.2 41 7/25/2019
2.0.1 63 7/24/2019
2.0.0 120 7/6/2019
1.2.1 588 6/13/2019
1.2.0 182 5/31/2019
1.1.4 143 5/17/2019
1.1.3 259 4/26/2019
1.1.2 114 4/25/2019
1.1.1 131 4/3/2019
1.1.0 95 3/30/2019
1.0.3 281 3/9/2019
1.0.2 166 2/9/2019
1.0.1 168 1/20/2019
1.0.0 153 1/20/2019
Show less