Persilsoft.Toast.Blazor
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Persilsoft.Toast.Blazor --version 1.0.1
NuGet\Install-Package Persilsoft.Toast.Blazor -Version 1.0.1
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.1" />
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.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Persilsoft.Toast.Blazor, 1.0.1"
#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.1 // Install Persilsoft.Toast.Blazor as a Cake Tool #tool nuget:?package=Persilsoft.Toast.Blazor&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.