# ToastState (@salmonui/notifications/toast)

> The ToastState interface of @salmonui/notifications/toast: A toast in the queue: its options plus store state.

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

```ts
import type { ToastState } 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 ToastState extends ToastOptions {
    readonly id: string;
    readonly closing: boolean;
    readonly run: number;
}
```

A toast in the queue: its options plus store state.

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  | Stable id returned by `queue.add()`. |
| `closing` | `readonly closing: boolean;` |  | True during the exit transition. |
| `run` | `readonly run: number;` |  | Increments when the timer restarts (an update of `duration`), so the countdown bar restarts. |
| `title` | `title?: ReactNode;` | optional, inherited | Heading line. |
| `description` | `description?: ReactNode;` | optional, inherited | Body text under the title. |
| `content` | `content?: ReactNode;` | optional, inherited | Replaces the default layout (icon, title, description, actions). |
| `tone` | `tone?: ToastTone;` | optional, inherited | Color role; `'danger'` toasts are `role="alert"`. Default `'neutral'`. |
| `icon` | `icon?: ReactNode;` | optional, inherited | Replaces the built-in tone icon; `false` hides it. Always decorative. |
| `duration` | `duration?: number;` | optional, inherited | 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;` | optional, inherited | Shows a close button; Escape on the focused toast also closes it. Default `false`. |
| `progress` | `progress?: boolean;` | optional, inherited | Shows the countdown bar (a CSS animation paused with the timer). |
| `actions` | `actions?: readonly ToastAction[];` | optional, inherited | Buttons in the toast. |
| `className` | `className?: string;` | optional, inherited | Extra class on the toast element. |
| `style` | `style?: CSSProperties;` | optional, inherited | Inline style on the toast element, for example a width. |
| `onOpen` | `onOpen?: ((id: string) => void);` | optional, inherited | Called when the toast enters the visible stack. |
| `onBeforeClose` | `onBeforeClose?: ((event: ToastBeforeCloseEvent) => void);` | optional, inherited | Called before the toast closes; `event.preventDefault()` keeps it. |
| `onClose` | `onClose?: ((event: ToastCloseEvent) => void);` | optional, inherited | Called when the toast closes, with the reason. |
| `onClick` | `onClick?: ((event: MouseEvent<HTMLElement, MouseEvent>) => void);` | optional, inherited | Called on a click anywhere in the toast. |
