# ToastOptions (@salmonui/notifications/toast)

> The ToastOptions interface of @salmonui/notifications/toast: The object passed to queue.add() and queue.update().

Canonical: https://salmonui.dev/docs/reference/notifications/toast/ToastOptions

```ts
import type { ToastOptions } from '@salmonui/notifications/toast';
```

Entry index: https://salmonui.dev/docs/reference/notifications/toast (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/notifications/toast.md).

## Reference

Kind: interface

```ts
interface ToastOptions {
    title?: ReactNode;
    description?: ReactNode;
    content?: ReactNode;
    tone?: ToastTone | undefined;
    icon?: ReactNode | false;
    duration?: number | undefined;
    dismissible?: boolean | undefined;
    progress?: boolean | undefined;
    actions?: readonly ToastAction[] | undefined;
    className?: string | undefined;
    style?: CSSProperties | undefined;
    onOpen?: ((id: string) => void) | undefined;
    onBeforeClose?: ((event: ToastBeforeCloseEvent) => void) | undefined;
    onClose?: ((event: ToastCloseEvent) => void) | undefined;
    onClick?: ((event: MouseEvent<HTMLElement>) => void) | undefined;
}
```

The object passed to `queue.add()` and `queue.update()`.

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `title` | `title?: ReactNode;` | optional | Heading line. |
| `description` | `description?: ReactNode;` | optional | Body text under the title. |
| `content` | `content?: ReactNode;` | optional | Replaces the default layout (icon, title, description, actions). |
| `tone` | `tone?: ToastTone \| undefined;` | optional | Color role; `'danger'` toasts are `role="alert"`. Default `'neutral'`. |
| `icon` | `icon?: ReactNode \| false;` | optional | Replaces the built-in tone icon; `false` hides it. Always decorative. |
| `duration` | `duration?: number \| undefined;` | optional | Time on screen in ms. Default 5000, or `Infinity` when the toast has actions; `Infinity` keeps it until dismissed. Counts only while visible and not paused. |
| `dismissible` | `dismissible?: boolean \| undefined;` | optional | Shows a close button; Escape on the focused toast also closes it. Default `false`. |
| `progress` | `progress?: boolean \| undefined;` | optional | Shows the countdown bar (a CSS animation paused with the timer). |
| `actions` | `actions?: readonly ToastAction[] \| undefined;` | optional | Buttons in the toast. |
| `className` | `className?: string \| undefined;` | optional | Extra class on the toast element. |
| `style` | `style?: CSSProperties \| undefined;` | optional | Inline style on the toast element, for example a width. |
| `onOpen` | `onOpen?: ((id: string) => void) \| undefined;` | optional | Called when the toast enters the visible stack. |
| `onBeforeClose` | `onBeforeClose?: ((event: ToastBeforeCloseEvent) => void) \| undefined;` | optional | Called before the toast closes; `event.preventDefault()` keeps it. |
| `onClose` | `onClose?: ((event: ToastCloseEvent) => void) \| undefined;` | optional | Called when the toast closes, with the reason. |
| `onClick` | `onClick?: ((event: MouseEvent<HTMLElement>) => void) \| undefined;` | optional | Called on a click anywhere in the toast. |
