Table of Contents

Class TwToastServiceExtensions

Namespace
TwBlazor.Services
Assembly
TwBlazor.dll

Extension methods for ITwToastService to simplify toast creation.

public static class TwToastServiceExtensions
Inheritance
TwToastServiceExtensions
Inherited Members

Methods

Show(ITwToastService, string, string?, Color?, Icon?, int)

Shows a custom toast notification.

public static void Show(this ITwToastService service, string title, string? message = null, Color? color = null, Icon? icon = null, int duration = 5000)

Parameters

service ITwToastService

The toast service.

title string

The title of the toast.

message string

The message content.

color Color?

The color theme of the toast.

icon Icon?

The icon to display.

duration int

The duration in milliseconds before auto-dismiss. Default is 5000ms.

ShowError(ITwToastService, string, string?, int)

Shows an error toast notification.

public static void ShowError(this ITwToastService service, string title, string? message = null, int duration = 5000)

Parameters

service ITwToastService

The toast service.

title string

The title of the toast.

message string

The message content.

duration int

The duration in milliseconds before auto-dismiss. Default is 5000ms.

ShowInfo(ITwToastService, string, string?, int)

Shows an info toast notification.

public static void ShowInfo(this ITwToastService service, string title, string? message = null, int duration = 5000)

Parameters

service ITwToastService

The toast service.

title string

The title of the toast.

message string

The message content.

duration int

The duration in milliseconds before auto-dismiss. Default is 5000ms.

ShowSuccess(ITwToastService, string, string?, int)

Shows a success toast notification.

public static void ShowSuccess(this ITwToastService service, string title, string? message = null, int duration = 5000)

Parameters

service ITwToastService

The toast service.

title string

The title of the toast.

message string

The message content.

duration int

The duration in milliseconds before auto-dismiss. Default is 5000ms.

ShowWarning(ITwToastService, string, string?, int)

Shows a warning toast notification.

public static void ShowWarning(this ITwToastService service, string title, string? message = null, int duration = 5000)

Parameters

service ITwToastService

The toast service.

title string

The title of the toast.

message string

The message content.

duration int

The duration in milliseconds before auto-dismiss. Default is 5000ms.