Netcode-Hub / DemoToastInBlazorWebApp

Toast of the Town : Effortlessly Implementing Toast Notifications in Your .NET 8 Web Applications https://youtu.be/j7_AgPgmhAo

Repository from Github https://github.comNetcode-Hub/DemoToastInBlazorWebAppRepository from Github https://github.comNetcode-Hub/DemoToastInBlazorWebApp

Toast of the Town : Effortlessly Implementing Toast Notifications in Your .NET 8 Web Applications https://youtu.be/j7_AgPgmhAo

Toast Server

How to use version 1.0.0

Install the package

  *NetcodeHub.Packages.Components.Toast *

Register Toast Service in the Program.cs file**

    *builder.Service.AddScope<ToastService>();*

Add Namespace

*@using NetcodeHub.Packages.Components.Toast*

Inject Toast Service

   *@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");

 }

How to use version 1.0.4

What is New?

  1. Introduction of Toast Position. a. Top b. Bottom

What is changed from version 1.0.0?

  1. No more injection of ToastService making it easy to use. Follow the below guidelines and choose version of choice.

Install the package

              NetcodeHub.Packages.Components.Toast

Add package Namespace to the _Import.razor file

           @using static NetcodeHub.Packages.Components.Toast.NetcodeHubToast

Use the package

             <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
Buy Me A Coffee
PLEASE DO NOT FOGET TO STAR THIS REPOSITORY

About

Toast of the Town : Effortlessly Implementing Toast Notifications in Your .NET 8 Web Applications https://youtu.be/j7_AgPgmhAo


Languages

Language:CSS 49.0%Language:HTML 46.0%Language:C# 5.0%