# Toasts

The `kvision-toastify` module contains ready to use functions to display toast messages - small, non-disruptive notification windows, which disappear automatically. To display a toast message just call one of the `primary`, `secondary`, `success`, `info`, `warning`, `danger` , `light` and `dark` functions of the `Toast` object.&#x20;

```kotlin
Toast.info("This is a toast message")

Toast.danger("There was an error!")
```

You can also pass `ToastOptions` parameter, to configure how the toast message is displayed.

```kotlin
Toast.success(
    "This is a toast message",
    options = ToastOptions(
        position = ToastPosition.TOPLEFT,
        close = true,
        duration = 10000
    )
)
```


---

# 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://kvision.gitbook.io/kvision-guide/3.-optional-ui-functionality-via-modules/toasts.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.
