Shows a [toast notification](../../components/toast.md) and returns its id. Invalid arguments raise an error in the calling script.

From a Perspective script the toast is shown on the page the script is running on. From a Gateway script, `sessionId` and `pageId` are required. The function raises an error in the Designer Script Console.

---

### Parameters

**paramsDict** `Dictionary`<br />
<table class='dictionaryKeyTable'>
 <tbody>
 <tr><td> - message</td><td>String</td><td>Required. The toast's text, up to 1000 characters.</td></tr>
 <tr><td> - title</td><td>String</td><td>Optional bold heading above the message, up to 1000 characters.</td></tr>
 <tr><td> - type</td><td>String</td><td>`info`, `success`, `warning`, `error` or `default` (the default). Sets the color and icon.</td></tr>
 <tr><td> - position</td><td>String</td><td>`top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center` (the default) or `bottom-right`.</td></tr>
 <tr><td> - animate</td><td>String</td><td>The entrance and exit animation: `bounce` (the default), `slide`, `zoom` or `flip`.</td></tr>
 <tr><td> - autoClose</td><td>Integer</td><td>Milliseconds before the toast closes. `0` keeps it open until it is dismissed. Defaults to 5000.</td></tr>
 <tr><td> - closeButton</td><td>Boolean</td><td>Show the close button. Defaults to `True`.</td></tr>
 <tr><td> - pauseOnHover</td><td>Boolean</td><td>Pause the auto-close timer while the pointer is over the toast. Defaults to `True`.</td></tr>
 <tr><td> - draggable</td><td>Boolean</td><td>Allow the toast to be swiped away. By default it can be swiped on touch screens only; pass `True` to allow dragging with a mouse as well.</td></tr>
 <tr><td> - loading</td><td>Boolean</td><td>Show a spinner and keep the toast open until it is updated. Defaults to `False`.</td></tr>
 <tr><td> - id</td><td>String</td><td>Your own id for the toast. One is generated if omitted.</td></tr>
 <tr><td> - sessionId</td><td>String</td><td>The session to show the toast in. Required from Gateway scripts.</td></tr>
 <tr><td> - pageId</td><td>String</td><td>The page to show the toast on. Required from Gateway scripts.</td></tr>
 </tbody>
</table>

---

### Returns

**toastId** `String`: The toast's id. Pass it to [update](./update.md) or [dismiss](./dismiss.md).<br />

---

### Example

```python
# Simple toast from a Perspective script
system.kanoa.toast.show({"message": "Lot 123 released", "type": "success"})

# Toast with a title that stays open until the user closes it
system.kanoa.toast.show({
    "title": "Line 1 stopped",
    "message": "Material shortage at the filler",
    "type": "warning",
    "autoClose": 0
})

# From a Gateway script (for example, a tag change script)
system.kanoa.toast.show({
    "message": "Batch complete",
    "type": "info",
    "sessionId": sessionId,
    "pageId": pageId
})

# Loading toast, updated when the work finishes
toastId = system.kanoa.toast.show({"message": "Releasing lot 123...", "loading": True})
```
