Toast of the Town : Effortlessly Implementing Toast Notifications in Your .NET 8 Web Applications https://youtu.be/j7_AgPgmhAo
*NetcodeHub.Packages.Components.Toast *
*builder.Service.AddScope<ToastService>();*
*@using NetcodeHub.Packages.Components.Toast*
*@inject ToastService ToastService*
*<Toast @ref="toastService.ToastComponent" IconClass="bi bi-check" Persist="false"/>*
*<button class="btn btn-info" @onclick="ShowToast">Show Toast</button>*
@code{
void ShowToast() =>toastService.ShowDangerToast("Title", "Message");
void ShowToast() =>toastService.ShowInfoToast("Title", "Message");
void ShowToast() =>toastService.ShowSuccessToast("Title", "Message");
void ShowToast() =>toastService.ShowWarningToast("Title", "Message");
}
- Introduction of Toast Position. a. Top b. Bottom
- No more injection of ToastService making it easy to use. Follow the below guidelines and choose version of choice.
NetcodeHub.Packages.Components.Toast
@using static NetcodeHub.Packages.Components.Toast.NetcodeHubToast
<NetcodeHubToast @ref="ToastComponent"
Position="@ToastPosition.Bottom / Top"
IconClass="bi bi-check"
Persist="false"
Duration=4000/>
<button class="btn btn-info" @onclick="ShowToast">Show Toast</button>
<br />
@code{
NetcodeHubToast? ToastComponent;
async Task ShowToast() =>
await ToastComponent!.ShowDangerToast("Title", "Message");
async Task ShowToast() =>
await ToastComponent!.ShowInfoToast("Title", "Message");
async Task ShowToast() =>
await ToastComponent!.ShowSuccessToast("Title", "Message");
async Task ShowToast() =>
await ToastComponent!.ShowWarningToast("Title", "Message");
}
/Follow Netcode-Hub/
https://netcodehub.blogspot.com
https://github.com/Netcode-Hub
https://twitter.com/NetcodeHub | Twitter
https://web.facebook.com/NetcodeHub | Facebook
https://www.linkedin.com/in/netcode-hub-90b188258/ | LinkedIn
/You can buy a coffee for me to support the channel/ ☕️
https://www.buymeacoffee.com/NetcodeHub

PLEASE DO NOT FOGET TO STAR THIS REPOSITORY
