Persilsoft.Toast.Blazor 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Persilsoft.Toast.Blazor --version 1.0.2                
NuGet\Install-Package Persilsoft.Toast.Blazor -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Persilsoft.Toast.Blazor" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Persilsoft.Toast.Blazor --version 1.0.2                
#r "nuget: Persilsoft.Toast.Blazor, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Persilsoft.Toast.Blazor as a Cake Addin
#addin nuget:?package=Persilsoft.Toast.Blazor&version=1.0.2

// Install Persilsoft.Toast.Blazor as a Cake Tool
#tool nuget:?package=Persilsoft.Toast.Blazor&version=1.0.2                

Persilsoft.Toast.Blazor

A Toast library for Blazor and Razor Components applications.


Example First, you need to register the component in the dependency injection service.

using ServiceCollectionExtensions;

builder.Services.AddToastService();

Then you need to add an AZToast component in your razor view, for example in the MainLayout component.

@using Persilsoft.Toast.Blazor

<div class="page">
    <div class="sidebar">
        <NavMenu />
    </div>
    <main>
        <article class="content px-4">
            @Body
        </article>
    </main>
</div>
<AZToast />

Finally you can use it.

@page "/"
@inject IToastService ToastService
@using @using Persilsoft.Toast.Blazor

<PageTitle>Toast Blazor</PageTitle>
<h1>Toast Blazor example</h1>
<hr />
<button class="btn btn-info" @onclick=ShowToastInfo>Show toast info</button>
<button class="btn btn-warning" @onclick=ShowToastWarning>Show toast warning</button>
<button class="btn btn-danger" @onclick=ShowToastError>Show toast danger</button>
<button class="btn btn-success" @onclick=ShowToastSuccess>Show toast success</button>

@code {
    private void ShowToastInfo()
    {
        ToastService.ShowInfo("Info!", "This is the show toast info");
    }

    private void ShowToastWarning()
    {
        ToastService.ShowWarning("Warning!", "This is the show toast warning");
    }

    private void ShowToastError()
    {
        ToastService.ShowError("Danger!", "This is the show toast error", 0);
    }

    private void ShowToastSuccess()
    {
        ToastService.ShowSuccess("Success!", "This is the show toast success");
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.8 80 10/16/2024
1.0.7 102 7/19/2024
1.0.6 222 5/21/2024
1.0.5 249 4/24/2024
1.0.4 106 4/18/2024
1.0.3 106 4/18/2024
1.0.2 103 4/18/2024
1.0.1 112 4/16/2024
1.0.0 113 4/16/2024