# Toastr

**Path:** Components/Feedback

[Back to Documentation Index](http://rubicblazor.skyconis.com/docs.md)

---

Toastr

 RbToastr provides lightweight notification toast messages to display information, success, warnings, and errors.
 Toasts appear temporarily and automatically dismiss, making them perfect for non-intrusive user feedback.

 Setup Required: 

 Add the following inject statement to your page or component:

 @inject RbToastrProvider toastr 

 Basic Usage

 Simple toast notifications with different types: Success, Info, Warning, Error, and Default.

 Show code

 Toast Types

 Success

 Info

 Warning

 Error

 Default

 Usage Examples

 Available Methods: 

 toastr.SuccessAsync(message) - Green success toast

 toastr.InfoAsync(message) - Blue information toast

 toastr.WarningAsync(message) - Yellow/Orange warning toast

 toastr.ErrorAsync(message) - Red error toast

 toastr.DefaultAsync(message) - Default styled toast

 With Titles

 Display toasts with custom titles and messages.

 Show code

 Toasts with Titles

 Save Success

 Update Info

 Session Warning

 Connection Error

 Real-World Examples

 Welcome Message

 Email Notification

 Unsaved Warning

 Login Error

 Method Signature

 All toast methods support an optional title parameter: 

 toastr.SuccessAsync(message, title) 
 toastr.InfoAsync(message, title) 
 toastr.WarningAsync(message, title) 
 toastr.ErrorAsync(message, title) 
 toastr.DefaultAsync(message, title) 

 Timeout

 Control automatic closing in seconds, or use zero and smaller values to keep a toast open until it is clicked.

 Show code

 Automatic Closing

 Default: 5 seconds

 Custom: 10 seconds

 Close on click

 TimeoutSeconds behavior: 

 The default value is 5 seconds.

 Positive values set an individual automatic close delay for each toast.

 Zero and smaller values disable automatic closing and hide the progress indicator.

 Hover pauses the automatic close progress of that toast.

 Custom Colors

 Use ShowAsync method with RbColor to display toasts with custom colors.

 Show code

 Custom Colors with ShowAsync

 Default 
 Primary 
 Secondary 
 Info 
 Warning 
 Danger 
 Success 

 Interactive Color Selector

 Default 
 Primary 
 Secondary 
 Info 
 Warning 
 Danger 
 Success 

 Show Toast with Selected Color

 Title 

 Message 

 Method Usage

 ShowAsync Method: 

 toastr.ShowAsync(RbColor color, string message, string title = null) 
 Example: 

 await toastr.ShowAsync(RbColor.Primary, "Custom colored message", "Custom Title"); 

 Rich Content

 Display toasts with HTML formatting, icons, emojis, and complex content.

 Show code

 Rich Content with HTML

 Formatted Success

 List Content

 Bold & Italic

 Multi-line

 Complex Notifications

 New User

 Order Status

 System Update

 New Message

 Icons and Emojis

 With Emoji

 With Icons

 Progress Update

 HTML Support

 Note: Toast messages support HTML content, allowing you to:

 Use <b> , <i> , <u> for text formatting

 Add <br> tags for line breaks

 Include <ul> and <li> for lists

 Use Font Awesome icons with <i class="fas fa-..."> 

 Add emojis and special characters

 RTL Support

 Demonstrate toast messages triggered from an RTL container.

 Show code

 إشعار نجاح

 إشعار تنبيه

 إشعار بعنوان

 ✕

 Contents
