# 6.1	Creating toast

A UDI can create “toast”: a short-lived pop-up message to the user, displayed at the edge of the screen. You create toast using the UDI.createToast() function. This takes two parameters: a definition of the toast to display, and an optional callback function which receives a notification if the user clicks on the toast. For example:

```
UDI.createToast({
	title: "Band breakout",
	text: "Price is above trend band"
}, function(toastDef) {
	// User has clicked on the toast
	// toastDef parameter is the definition passed to createToast
});
```

The available options for toast are described in full in the Framework reference, but the key values are as follows:

&#x20;

| Property | Description                                                                                            |
| -------- | ------------------------------------------------------------------------------------------------------ |
| text     | Body text of the notification                                                                          |
| title    | Title for the notification. (Not compulsory.)                                                          |
| icon     | Hexadecimal code of an icon in the FontAwesome set, such as "f05a" for an info icon. (Not compulsory.) |
| lifespan | Lifespan of the toast in seconds, overriding the app's default                                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/sway-charts-pro-user-defined-indicators/notifying-the-user/6.1-creating-toast.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
