HxToastContainer wrapper for displaying HxToast messages dispatched through IHxMessengerService.

Component is using IHxMessengerService injected service.

Informational messages are automatically hidden after 5 seconds, warning and error messages remain visible till manually closed.

Basic usage

You should place the HxMessenger component itself to the layout component (MainLayout.razor) to make it work!

@inherits LayoutComponentBase

<HxMessenger Position="HxToastContainerPosition.TopEnd" />


Call services.AddHxMessenger() in Startup.cs to setup related services.

public void ConfigureServices(IServiceCollection services)
	// ...
	// ...

Clearing messages

Use messenger.Clear() method (IHxMessengerService) if you want all messages to disappear immediately.



Name Type Description
Position HxToastContainerPosition Position of the messages. Default is HxToastContainerPosition.None.
CssClass string Additional CSS class.
An unhandled error has occurred. Reload 🗙