Class Toast
Inherited Members
Namespace: Syncfusion.EJ2.Notifications
Assembly: Syncfusion.EJ2.dll
Syntax
public class Toast : EJTagHelper
Constructors
Toast()
Declaration
public Toast()
Properties
Animation
Specifies the animation configuration settings for showing and hiding the Toast.
Declaration
[HtmlAttributeName("animation")]
public ToastToastAnimationSettings Animation { get; set; }
Property Value
Type | Description |
---|---|
ToastToastAnimationSettings | The default value is null |
BeforeClose
Triggers the event before the toast close.
Declaration
[HtmlAttributeName("beforeClose")]
public string BeforeClose { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
BeforeOpen
Triggers the event before the toast shown.
Declaration
[HtmlAttributeName("beforeOpen")]
public string BeforeOpen { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
BeforeSanitizeHtml
Event triggers before sanitize the value.
Declaration
[HtmlAttributeName("beforeSanitizeHtml")]
public string BeforeSanitizeHtml { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Buttons
Specifies the collection of Toast action buttons
to be rendered with the given
Button model properties and its click action handler.
Declaration
[HtmlAttributeName("buttons")]
public List<ToastButtonModelProp> Buttons { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ToastButtonModelProp> | The default value is null |
Click
The event will be fired while clicking on the Toast.
Declaration
[HtmlAttributeName("click")]
public string Click { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Close
Trigger the event after the Toast hides.
Declaration
[HtmlAttributeName("close")]
public string Close { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Content
Specifies the content to be displayed on the Toast. Accepts selectors, string values and HTML elements.
Declaration
[HtmlAttributeName("content")]
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
ContentTemplate
To get or set value for ContentTemplate.
Declaration
public MvcTemplate<object> ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
MvcTemplate<System.Object> |
Created
Triggers the event after the Toast gets created.
Declaration
[HtmlAttributeName("created")]
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CssClass
Defines single/multiple classes (separated by space) to be used for customization of Toast.
Declaration
[HtmlAttributeName("cssClass")]
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Destroyed
Triggers the event after the Toast gets destroyed.
Declaration
[HtmlAttributeName("destroyed")]
public string Destroyed { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
EnableHtmlSanitizer
Defines whether to allow the cross-scripting site or not.
Declaration
[HtmlAttributeName("enableHtmlSanitizer")]
public bool EnableHtmlSanitizer { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
EnablePersistence
Enable or disable persisting component's state between page reloads.
Declaration
[HtmlAttributeName("enablePersistence")]
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
[HtmlAttributeName("enableRtl")]
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
ExtendedTimeout
Specifies the Toast display time duration after interacting with the Toast.
Declaration
[HtmlAttributeName("extendedTimeout")]
public double ExtendedTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 1000 |
Height
Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.
Declaration
[HtmlAttributeName("height")]
public string Height { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "auto" |
HtmlAttributes
Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.
Declaration
[HtmlAttributeName("htmlAttributes")]
public object HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Icon
Defines CSS classes to specify an icon for the Toast which is to be displayed at top left corner of the Toast.
Declaration
[HtmlAttributeName("icon")]
public string Icon { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
[HtmlAttributeName("locale")]
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
NewestOnTop
Specifies the newly created Toast message display order while multiple toast's are added to page one after another. By default, newly added Toast will be added after old Toast's.
Declaration
[HtmlAttributeName("newestOnTop")]
public bool NewestOnTop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
Open
Triggers the event after the Toast shown on the target container.
Declaration
[HtmlAttributeName("open")]
public string Open { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Position
Specifies the position of the Toast message to be displayed within target container. In the case of multiple Toast display, new Toast position will not update on dynamic change of property values until the old Toast messages removed. X values are: Left , Right ,Center Y values are: Top , Bottom
Declaration
[HtmlAttributeName("position")]
public ToastToastPosition Position { get; set; }
Property Value
Type | Description |
---|---|
ToastToastPosition | The default value is null |
ProgressDirection
Specifies whether to show the progress bar with left to right direction to denote the Toast message display timeout.
Declaration
[HtmlAttributeName("progressDirection")]
public ProgressDirectionType ProgressDirection { get; set; }
Property Value
Type | Description |
---|---|
ProgressDirectionType | The default value is null |
ShowCloseButton
Specifies whether to show the close button in Toast message to close the Toast.
Declaration
[HtmlAttributeName("showCloseButton")]
public bool ShowCloseButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
ShowProgressBar
Specifies whether to show the progress bar to denote the Toast message display timeout.
Declaration
[HtmlAttributeName("showProgressBar")]
public bool ShowProgressBar { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
Target
Specifies the target container where the Toast to be displayed.
Based on the target, the positions such as Left
, Top
will be applied to the Toast.
The default value is null, which refers the document.body
element.
Declaration
[HtmlAttributeName("target")]
public string Target { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Template
Specifies the HTML element/element ID as a string that can be displayed as a Toast. The given template is taken as preference to render the Toast, even if the built-in properties such as title and content are defined.
Declaration
[HtmlAttributeName("template")]
public string Template { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
TimeOut
Specifies the Toast display time duration on the page in milliseconds.
- Once the time expires, Toast message will be removed.
- Setting 0 as a time out value displays the Toast on the page until the user closes it manually.
Declaration
[HtmlAttributeName("timeOut")]
public double TimeOut { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 5000 |
Title
Specifies the title to be displayed on the Toast. Accepts selectors, string values and HTML elements.
Declaration
[HtmlAttributeName("title")]
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Width
Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels.
In mobile devices, default width is considered as 100%
.
Declaration
[HtmlAttributeName("width")]
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "300" |