> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# showToast()

> Shows a toast to the user

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/notification.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=52ecd1f9a39275ac87e8a237d90f3bb6" data-path="images/notification.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/notification-dark.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=187a1966010df57261ac572a80172660" data-path="images/notification-dark.png" />

```js theme={"system"}
import {showToast} from "attio/client"
```

A [toast](https://en.wikipedia.org/wiki/Pop-up_notification) is a subtle, usually temporary,
pop-up notification to let the user know that something is happening or has just happened.

<Tip>
  These are useful to show when you are performing asynchronous actions such as loading or saving
  data.
</Tip>

## API

```ts TypeScript theme={"system"}
async function showToast(options: Options): Promise<{
  hideToast: () => Promise<void>
}>
```

## Returns

A `Promise` that resolves to an object containing:

<ResponseField name="hideToast" type="() => Promise<void>">
  By calling `hideToast()` you can imperatively hide the toast.

  <Tip>Useful if your toast was showing a "loading" or "saving" message.</Tip>
</ResponseField>

## Options

<ParamField path="title" type="string" required>
  The title of the toast.
</ParamField>

<ParamField path="text" type="string" required>
  The text of the toast.
</ParamField>

<ParamField path="action" type="{ label: string, onClick: () => void }">
  An optional action button that can execute code if and when the user triggers it.
</ParamField>

<ParamField path="durationMs" type="number">
  How long to keep the toast open.

  Defaults to `4_000` (four seconds)

  <Tip>
    If you want the toast to remain open indefinitely, you can pass `Number.POSITIVE_INFINITY`.

    <Warning>Only do this if you do ***not*** have `dismissable` set to `false`!</Warning>
  </Tip>
</ParamField>

<ParamField path="dismissable" type="boolean">
  Whether or not to allow the user to dismiss the toast.

  Defaults to `true`.
</ParamField>
