> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: StatusToast Component

## Article: StatusToast Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/feedback/status-toast-component.md

## Article Content:

# StatusToast

_Components/Feedback_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/statustoast>

## Overview

```jsx
<Box align="center">
  <StatusToast
    key="changes-saved"
    status="success"
    dismissible
    action={<StatusToast.Action>Undo</StatusToast.Action>}
  >
    Changes saved
  </StatusToast>
</Box>;
```

A status toast notifies users about a status change in an application.

### Do

- Use it to provide contextual feedback on the outcome of user action.
- Use clear language and provide an actionable next step when applicable.
- Provide one main action only (e.g., "Dismiss" or "Retry") to avoid complexity.
- Use it to communicate status changes even when the user is inside a modal.

### Don't

- Don't add more than one action.
- Don't use it for application-level messages. Use `<SectionHelper/>` instead.
- Don't display identical toasts repeatedly. If an error persists, try a single persistent notification.
- Don't use it as a navigation control between pages. Use `<NavigationToast/>` instead.

### Feature examples

#### Status

Control the toast type with the `status` prop:

- `success` is for a toast displayed after a successful action.
- `error` is used for error messages and information about critical issues that prevent users from continuing.
- `warning` is meant to draw the user's attention to unresolved issues that might affect the application but doesn't block the process.
- `info` is for informational updates that aren't urgent.

```jsx
<StorybookComponents.Stack flexDirection="column" gap="24px">
  <StatusToast
    key="success"
    status="success"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Success
  </StatusToast>
  <StatusToast
    key="error"
    status="error"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Error
  </StatusToast>
  <StatusToast
    key="warning"
    status="warning"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Warning
  </StatusToast>
  <StatusToast
    key="info"
    status="info"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Info
  </StatusToast>
</StorybookComponents.Stack>;
```

#### Close button

Control whether the user can dismiss a status toast with the`dismissible` prop.

NOTE: If this is not enabled, `error`, `warning` and `info` toasts will remain visible on the screen until an action is taken or the issue is resolved.

```jsx
<StorybookComponents.Stack flexDirection="column" gap="24px">
  <StatusToast
    key="dismissable"
    status="error"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Dismissable
  </StatusToast>
  <StatusToast
    key="non-dismissable"
    status="error"
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    Non-dismissable
  </StatusToast>
</StorybookComponents.Stack>;
```

#### Action

Add a button to a notification with the `action` prop. Offer one action only to avoid complexity.

```jsx
<StorybookComponents.Stack flexDirection="column" gap="24px">
  <StatusToast
    key="with-action"
    status="success"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    With action
  </StatusToast>
  <StatusToast key="without-action" status="success" dismissible>
    Without action
  </StatusToast>
</StorybookComponents.Stack>;
```

#### Width

Component width is fixed to 600px. If the context exceeds the length, it will wrap to the next line.

```jsx
<StatusToast
  key="width-is-600px"
  status="warning"
  dismissible
  action={<StatusToast.Action>Action</StatusToast.Action>}
>
  Width is 600px
</StatusToast>;
```

#### Height

Minimum component height is 42px. The component height will grow together with the content. Height is not limited, so be cautious about using very long texts, as a long message will cover any content behind it.

```jsx
<StorybookComponents.Stack flexDirection="column" gap="24px">
  <StatusToast
    key="one-line"
    status="warning"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    This is a one-line content example{' '}
  </StatusToast>
  <StatusToast
    key="multi-line"
    status="warning"
    dismissible
    action={<StatusToast.Action>Action</StatusToast.Action>}
  >
    This is a much longer content example that wraps automatically to a second
    line while the status toast height grows with it{' '}
  </StatusToast>
</StorybookComponents.Stack>;
```

#### Positioning

The position of a status toast is not customizable. `<ToastContainer/>` position is attached to the viewport with 26px gap from the bottom and not to the parent container or content within the page.

```jsx
(() => {
  const makeId = () => Math.random().toString(36).substring(2, 9);

  const Blank = () => (
    <div
      style={{
        background:
          'repeating-linear-gradient(45deg, rgba(0,0,0,0.2), rgba(0,0,0,0.2) 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px)',
        flex: '1 1 auto',
      }}
    />
  );

  const Example = () => {
    const [toasts, setToasts] = React.useState([]);

    const clearToasts = () => {
      setToasts([]);
    };

    const removeToast = (id) => {
      setToasts((toasts) => toasts.filter((toast) => toast.id !== id));
    };

    const addToast = (id, toast) => {
      setToasts((toasts) => [...toasts, { id, toast }]);
    };

    const createStatusToast = (status, content, action) => {
      const id = makeId();

      addToast(
        id,
        <StatusToast
          key={id}
          dataHook={id}
          status={status}
          dismissible
          dismissLabel="Dismiss"
          onDismiss={() => {
            removeToast(id);
          }}
          action={action}
        >
          {content}
        </StatusToast>,
      );
    };

    return (
      <>
        <Box gap={1}>
          <Button
            size="small"
            onClick={() =>
              createStatusToast(
                'success',
                'I am placed 26px from the bottom of the screen',
                <StatusToast.Action>Got it</StatusToast.Action>,
              )
            }
          >
            Click here to see positioning
          </Button>
        </Box>
        <ToastContainer>{toasts.map(({ toast }) => toast)}</ToastContainer>
      </>
    );
  };

  return Example;
})();
```

#### Timeout

Whether notification disappears automatically or not can be controlled with `duration` prop.

Recommended delay until toast disappears is at least **7 seconds**.

When possible, it is recommended to make `error` toasts persistent, giving the user a chance to resolve the error or dismiss it at their own pace.

```jsx
(() => {
  const makeId = () => Math.random().toString(36).substring(2, 9);

  const Blank = () => (
    <div
      style={{
        background:
          'repeating-linear-gradient(45deg, rgba(0,0,0,0.2), rgba(0,0,0,0.2) 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px)',
        flex: '1 1 auto',
      }}
    />
  );

  const Example = () => {
    const [toasts, setToasts] = React.useState([]);

    const clearToasts = () => {
      setToasts([]);
    };

    const removeToast = (id) => {
      setToasts((toasts) => toasts.filter((toast) => toast.id !== id));
    };

    const addToast = (id, toast) => {
      setToasts((toasts) => [...toasts, { id, toast }]);
    };

    const createStatusToast = (status, content, action) => {
      const id = makeId();

      addToast(
        id,
        <StatusToast
          key={id}
          dataHook={id}
          status={status}
          dismissible
          dismissLabel="Dismiss"
          onDismiss={() => {
            removeToast(id);
          }}
          action={action}
        >
          {content}
        </StatusToast>,
      );
    };

    return (
      <>
        <Box gap={1}>
          <Button
            size="small"
            onClick={() =>
              createStatusToast(
                'info',
                'Info toast - no timeout',
                <StatusToast.Action>Action</StatusToast.Action>,
              )
            }
          >
            Info
          </Button>
          <Button
            size="small"
            onClick={() =>
              createStatusToast(
                'warning',
                'Warning toast - no timeout',
                <StatusToast.Action>Action</StatusToast.Action>,
              )
            }
          >
            Warning
          </Button>
          <Button
            size="small"
            onClick={() =>
              createStatusToast(
                'error',
                'Error toast - no timeout',
                <StatusToast.Action>Action</StatusToast.Action>,
              )
            }
          >
            Error
          </Button>
          <Button
            size="small"
            onClick={() =>
              createStatusToast(
                'success',
                'Success toast - timeout after 7 seconds',
                <StatusToast.Action>Action</StatusToast.Action>,
              )
            }
          >
            Success
          </Button>
          {toasts.length ? (
            <Tooltip content="Clear">
              <IconButton
                size="small"
                onClick={clearToasts}
                priority="secondary"
              >
                <Icons.DeleteSmall />
              </IconButton>
            </Tooltip>
          ) : null}
        </Box>
        <ToastContainer>{toasts.map(({ toast }) => toast)}</ToastContainer>
      </>
    );
  };

  return Example;
})();
```

#### Stacking

By default, only one toast is visible at a time and the rest will be hidden under the first one.

However, you can control how many toast are visible at the same time. **Up to thee toast** can be visible at the same time. If more than given number is shown, they will be stacked with 6px gap between each other.

If three toasts are already visible, the newest one will be shown instead of the oldest one, until a slot is freed up by closing a toast, solving an issue, or it times out.

```jsx
() => {
  const makeId = () => Math.random().toString(36).substring(2, 9);

  const [toasts, setToasts] = React.useState([]);

  const clearToasts = () => {
    setToasts([]);
  };

  const removeToast = (id) => {
    setToasts((toasts) => toasts.filter((toast) => toast.id !== id));
  };

  const addToast = (id, toast) => {
    setToasts((toasts) => [...toasts, { id, toast }]);
  };

  const createStatusToast = (status, content, action) => {
    const id = makeId();

    addToast(
      id,
      <StatusToast
        key={id}
        dataHook={id}
        status={status}
        dismissible
        dismissLabel="Dismiss"
        onDismiss={() => {
          removeToast(id);
        }}
        action={action}
      >
        {content}
      </StatusToast>,
    );
  };

  return (
    <>
      <Box gap={1}>
        <Button
          size="small"
          onClick={() =>
            createStatusToast(
              'error',
              'I am 1st toast',
              <StatusToast.Action>Action</StatusToast.Action>,
            )
          }
        >
          1st toast
        </Button>
        <Button
          size="small"
          onClick={() =>
            createStatusToast(
              'error',
              'I am 2nd toast',
              <StatusToast.Action>Action</StatusToast.Action>,
            )
          }
        >
          2nd toast
        </Button>
        <Button
          size="small"
          onClick={() =>
            createStatusToast(
              'error',
              'I am 3rd toast',
              <StatusToast.Action>Action</StatusToast.Action>,
            )
          }
        >
          3rd toast
        </Button>
        <Button
          size="small"
          onClick={() =>
            createStatusToast(
              'error',
              'I am 4th toast',
              <StatusToast.Action>Action</StatusToast.Action>,
            )
          }
        >
          4th toast
        </Button>
        {toasts.length ? (
          <Tooltip content="Clear">
            <IconButton size="small" onClick={clearToasts} priority="secondary">
              <Icons.DeleteSmall />
            </IconButton>
          </Tooltip>
        ) : null}
      </Box>

      <ToastContainer maxToasts={3}>
        {toasts.map(({ toast }) => toast)}
      </ToastContainer>
    </>
  );
};
```

### Common use case examples

#### In modals

Status toasts should be used inside of modals as well. Toasts in modals have the same logic as in pages. They appear at the same location, with an offset of 26px from the bottom of the page and have the same stacking behavior.

```jsx
() => {
  const [shown, setShown] = React.useState(false);
  const [copy, setCopy] = React.useState(false);
  const [toast, setToast] = React.useState(null);

  const createStatusToast = (status, content, action) => {
    setToast(
      <StatusToast
        key={'test-id'}
        status={status}
        dismissible
        dismissLabel="Dismiss"
        onDismiss={clearToast}
        action={action}
      >
        {content}
      </StatusToast>,
    );
  };

  const clearToast = () => {
    setToast(null);
  };

  const onShowModal = () => {
    setShown(true);
    createStatusToast(
      'error',
      'Your internet connection has been lost. Refresh and try again',
      <StatusToast.Action>Refresh</StatusToast.Action>,
    );
  };

  const onCloseModal = () => {
    setShown(false);
    clearToast();
  };

  const data = [
    { name: 'User 1', plan: 'Gold', email: 'user1@mail.com' },
    { name: 'User 2', plan: 'Silver', email: 'user2@mail.com' },
    { name: 'User 3', plan: 'Gold', email: 'user3@mail.com' },
    { name: 'User 4', plan: 'Gold', email: 'user4@mail.com' },
    { name: 'User 5', plan: 'Bronze', email: 'user5@mail.com' },
    { name: 'User 6', plan: 'Bronze', email: 'user6@mail.com' },
    { name: 'User 7', plan: 'Gold', email: 'user7@mail.com' },
    { name: 'User 8', plan: 'Bronze', email: 'user8@mail.com' },
  ];
  const columns = [
    { title: 'Name', render: (row) => row.name },
    { title: 'Plan', render: (row) => row.plan },
    { title: 'Email', render: (row) => row.email },
  ];

  return (
    <>
      <Card>
        <Card.Header
          title="Send coupons to your members"
          subtitle="Select members who will receive a new coupon via email."
          suffix={
            <Button size="small" priority="secondary" onClick={onShowModal}>
              Send Coupons
            </Button>
          }
        />
        <Modal
          isOpen={shown}
          onRequestClose={onCloseModal}
          shouldCloseOnOverlayClick
          screen="desktop"
        >
          <CustomModalLayout
            title="Send coupons to members"
            subtitle="Select members who will receive coupons via email."
            onCloseButtonClick={() => setShown(false)}
            primaryButtonOnClick={() => setShown(false)}
            secondaryButtonOnClick={() => setShown(false)}
            width="720px"
            maxHeight="350px"
            removeContentPadding
            primaryButtonText="Send"
            secondaryButtonText="Cancel"
            sideActions={
              <Checkbox
                size="small"
                checked={copy}
                onChange={() => setCopy(!copy)}
              >
                Send copy Email to myself
              </Checkbox>
            }
            content={
              <Table data={data} columns={columns} showSelection>
                <Table.Content />
              </Table>
            }
          />
        </Modal>
      </Card>
      <ToastContainer>{toast}</ToastContainer>
    </>
  );
};
```

## Code

```jsx
import { StatusToast } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `action` | `ReactNode` | — | Action element to render. |
| `children` | `ReactNode` | — | Sets the message shown in the toast. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `dismissible` | `boolean` | — | Whether the toast should render the dismiss button. |
| `dismissLabel` | `string` | — | Aria label for the dismiss button. |
| `duration` | `null \| number` | — | Number in milliseconds to auto dismiss the toast. If the duration is set to 'null', toast won't be automatically dismissed. |
| `id` | `string` | — | Sets the `id` HTML attribute of the toast root element. |
| `onDismiss` | `(event?: MouseEvent<Element, MouseEvent> \| undefined) => void` | — | Callback function called whenever the user clicks the dismiss button. |
| `status` | `"error" \| "warning" \| "success" \| "info"` | `'info'` | Controls the icon, color and ARIA role of the toast. The `'error'` and `'warning'` statuses use the `alert` role, and the `'info'` and `'success'` statuses auto dismiss after 7000 milliseconds by default. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { StatusToastUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { StatusToastTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { StatusToastTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { StatusToastTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `getStatus` | — |
| `getContent` | — |
| `getRole` | — |
| `getAriaLive` | — |
| `isVisible` | — |
| `isDismissible` | — |
| `getDismissButton` | — |
| `dismissButton` | — |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns UniDriver for the base element. |

## Changelog

- **1.340.0** (2026-10-21) — fix: the action stays visible on hover in Studio 2.0 (odeditor-dark). ([#17542](invalid-url))
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.331.0** (2026-10-01) — maintenance release, no component-specific changes
- **1.329.0** (2026-09-24) — maintenance release, no component-specific changes
- **1.328.0** (2026-09-22) — maintenance release, no component-specific changes
- **1.318.0** (2026-08-28) — maintenance release, no component-specific changes
- **1.313.1** (2026-08-18) — fix: the action button text is now smaller in every theme. ([#16792](invalid-url)) — has visual changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.271.0** (2026-04-22) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.242.0** (2025-12-19) — maintenance release, no component-specific changes
- **1.241.0** (2025-12-17) — maintenance release, no component-specific changes
- **1.228.0** (2025-11-18) — maintenance release, no component-specific changes
- **1.227.0** (2025-11-13) — feat: add mobile styles for StatusToast ([#15491](invalid-url))
- **1.216.0** (2025-09-01) — maintenance release, no component-specific changes
- **1.207.0** (2025-07-24) — maintenance release, no component-specific changes
- **1.204.1** (2025-07-09) — fix: improve StatusToast component layout and alignment ([#15008](invalid-url))
- **1.199.0** (2025-06-13) — maintenance release, no component-specific changes
- **1.183.0** (2025-04-24) — maintenance release, no component-specific changes
- **1.172.1** (2025-03-21) — maintenance release, no component-specific changes
- **1.144.0** (2024-12-03) — breaking: reduced width ([#14341](invalid-url))
- **1.141.0** (2024-11-19) — feat: auto dismiss duration control & info status default duration ([#14286](invalid-url))
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.131.0** (2024-10-10) — maintenance release, no component-specific changes