# Toast

Unlike the static [`MessageBox`](https://docs.wisej.com/docs/controls/notifications/messagebox) and [`AlertBox`](https://docs.wisej.com/docs/controls/notifications/alertbox), the Wisej.NET `Toast` is an instantiable component that can be reused and updated while visible.

Position the `Toast` in any of 9 standard locations (default: `TopCenter`). It displays an icon and text content, with optional HTML support via the `AllowHtml` property.

{% hint style="warning" %}
`Toast` notifications auto-close after 5 seconds by default but don't auto-dispose. Enable `AutoDispose` for automatic disposal on close. Handle the `Click` event for user interactions and the `Close` event for cleanup operations.
{% endhint %}

{% hint style="info" %}
For a full list of properties, methods and events see the [API documentation.](http://docs.wisej.com/api)
{% endhint %}

## Features

### Delayed Closing

The `AutoCloseDelay` property controls notification display duration.

![Toast notification with custom auto-close delay](https://553579532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MF1D11gPs_az3xaKusw%2Fuploads%2Fgit-blob-800f87a4699475dca2af6f2f061e85ba1a109379%2FShow%20Toast.gif?alt=media)

### HTML Content

Enable HTML content by setting the `AllowHtml` property to `true`:

![Toast displaying HTML formatted content](https://553579532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MF1D11gPs_az3xaKusw%2Fuploads%2Fgit-blob-d6bc4d547563b4a67cb8e0359ebe81e283fed84a%2Fimage.png?alt=media)

{% tabs %}
{% tab title="C#" %}

```csharp
var toast = new Toast
{
	AllowHtml = true,
	Text = @"<ul>
	  <li>Coffee</li>
	  <li>Tea</li>
	  <li>Milk</li>
	  </ul>"
};
toast.Show();
```

{% endtab %}
{% endtabs %}

## Advanced

### JavaScript Widget

| Item             | Description                                                                                                         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| Class name       | "wisej.web.Toast"                                                                                                   |
| Theme appearance | "toast", see [Themes](https://docs.wisej.com/theme-builder/theme-elements/elements)                                 |
| Source code      | [https://github.com/iceteagroup/wisej-js](https://github.com/iceteagroup/wisej-js/blob/master/wisej.web.TextBox.js) |
