> 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: MessageModalLayout Component

## Article: MessageModalLayout Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/overlays/modal/message-modal-layout-component.md

## Article Content:

# MessageModalLayout

_Components/Overlays/Modal_

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

## Overview

```jsx
<Box align="center">
  <MessageModalLayout
    primaryButtonText="Archive"
    secondaryButtonText="Cancel"
    title="Archive your program"
    onCloseButtonClick={() => {}}
  >
    <Text>
      When you archive this program, it will be stored in 'Archive' folder.
    </Text>
  </MessageModalLayout>
</Box>;
```

Message modals display short messages letting users confirm or cancel an action before moving forward. They're used inside `<Modal/>` overlays.

### Do

- Get confirmation before destructive or irreversible actions.
- Update users about important changes, such as updated terms and conditions.
- Inform users that selected features are Premium and upgrading is required.
- Use it after an intentional user action and only when it is completely necessary. Because they are intrusive, modals should be used sparingly.

### Don't

- Don't show more detailed custom content. Use `<CustomModalLayout/>` instead.
- Don't preview files like images, videos or PDFs. Use `<ModalPreviewLayout/>` instead.
- Don't use them in mobile environments. Use `<ModalMobileLayout/>` instead.

### Feature examples

#### Skin

Use different `skin` to set the overall look of the modal and its action buttons:

- For general cases use `standard`(default).
- Promote Premium features with `premium`.
- To inform users of the negative implications of an action, like loss of data, use `destructive` .

```jsx
<StorybookComponents.Stack flexDirection="column">
  <MessageModalLayout
    skin="standard"
    onCloseButtonClick={() => {}}
    primaryButtonText="Leave Page"
    secondaryButtonText="Cancel"
    title="Leave page?"
    content={
      <Text>When you leave this page, you'll lose unsaved changes.</Text>
    }
  />
  <MessageModalLayout
    skin="premium"
    onCloseButtonClick={() => {}}
    primaryButtonText="Upgrade"
    secondaryButtonText="Not Now"
    title="Upgrade to accept payments"
    content={
      <Text>To accept payments, upgrade to the Business Basic plan.</Text>
    }
  />
  <MessageModalLayout
    skin="destructive"
    onCloseButtonClick={() => {}}
    primaryButtonText="Delete"
    secondaryButtonText="Cancel"
    title="Delete category?"
    content={
      <Text>
        You're about to delete the <b>Yoga</b> category. Posts inside this
        category will also be deleted.
      </Text>
    }
  />
</StorybookComponents.Stack>;
```

#### Help and close buttons

Add a help button with the `onHelpButtonClick` prop. Use it to direct users to support.

Close button is required for all modals. Control its function with the`onCloseButtonClick` prop.

Both can be customised with `closeButtonProps` and `helpButtonProps`.

```jsx
<MessageModalLayout
  onCloseButtonClick={() => {}}
  onHelpButtonClick={() => {}}
  primaryButtonText="Leave Page"
  secondaryButtonText="Cancel"
  title="Leave page?"
  content={<Text>When you leave this page, you'll lose unsaved changes.</Text>}
/>;
```

#### Illustration

Add visuals to the left side of the content to support main modal messages using the `illustration` prop.

Use 120x120 px illustrations and coordinate the skin with the theme of the modal.

_Note_: For Wix products, browse all available illustrations or request a new one on [Wix UX Illustrations](https://www.wixuxillustrations.com/).

```jsx
<StorybookComponents.Stack flexDirection="column">
  <MessageModalLayout
    illustration="generic_report.svg"
    onCloseButtonClick={() => {}}
    primaryButtonText="Report"
    secondaryButtonText="Cancel"
    title="Report as spam?"
    content={<Text>Messages marked as spam are blocked from your inbox.</Text>}
  />
  <MessageModalLayout
    illustration="generic_upgrade.svg"
    theme={'premium'}
    onCloseButtonClick={() => {}}
    primaryButtonText="Upgrade"
    secondaryButtonText="Not Now"
    title="Start accepting online payments"
    content={
      <Text>
        Upgrade your site to a Business Basic plan to start accepting payments.
      </Text>
    }
  />
  <MessageModalLayout
    illustration="generic_trash.svg"
    theme={'destructive'}
    onCloseButtonClick={() => {}}
    primaryButtonText="Delete"
    secondaryButtonText="Cancel"
    title="Delete category"
    content={
      <Text>
        You're about to delete the <b>Yoga</b> category. Posts inside this
        category will also be deleted.
      </Text>
    }
  />
</StorybookComponents.Stack>;
```

#### Side actions

Add supplementary actions in the `sideActions` container.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <MessageModalLayout
    onCloseButtonClick={() => {}}
    primaryButtonText="Leave Page"
    secondaryButtonText="Cancel"
    title="Leave page?"
    content={
      <Text>When you leave this page, you'll lose unsaved changes.</Text>
    }
    sideActions={
      <StorybookComponents.Placeholder>
        Side actions
      </StorybookComponents.Placeholder>
    }
  />
  <MessageModalLayout
    onCloseButtonClick={() => {}}
    primaryButtonText="Leave Page"
    secondaryButtonText="Cancel"
    title="Leave page?"
    content={
      <Text>When you leave this page, you'll lose unsaved changes.</Text>
    }
    sideActions={<Checkbox>Don't show this again</Checkbox>}
  />
</StorybookComponents.Stack>;
```

#### Footnote

Add supplementary text and/or links into the `footnote` container.

Use the `footnoteSkin` prop to define it as `neutral` (default) or `light`.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <MessageModalLayout
    onCloseButtonClick={() => {}}
    primaryButtonText="Invite All"
    secondaryButtonText="Cancel"
    title="Invite all site members"
    content={<Text>You're about to send invites to all site members.</Text>}
    footnote={
      <StorybookComponents.Placeholder>
        Footnote
      </StorybookComponents.Placeholder>
    }
  />
  <MessageModalLayout
    onCloseButtonClick={() => {}}
    primaryButtonText="Invite All"
    secondaryButtonText="Cancel"
    title="Invite all site members"
    content={<Text>You're about to send invites to all site members.</Text>}
    footnote={
      <Text size="small">
        By sending an invite, you agree to the <a>Wix Terms of Use.</a>
      </Text>
    }
  />
  <MessageModalLayout
    onCloseButtonClick={() => {}}
    primaryButtonText="Invite All"
    secondaryButtonText="Cancel"
    title="Invite all site members"
    footnoteSkin="light"
    footnote={
      <Text size="small">
        By sending an invite, you agree to the <a>Terms of Use</a>.
      </Text>
    }
    content={<Text>You're about to send invites to all site members.</Text>}
  />
</StorybookComponents.Stack>;
```

#### Title and subtitle

Add short text to summarize modal content using the `title` prop.

Use optional `subtitle` prop to add secondary text below the modal title.

```jsx
<MessageModalLayout
  onCloseButtonClick={() => {}}
  primaryButtonText="Leave Page"
  secondaryButtonText="Cancel"
  title="Leave page?"
  content={<Text>When you leave this page, you'll lose unsaved changes.</Text>}
/>;
```

#### Action buttons

Specify labels for primary and secondary actions with `primaryButtonText` and `secondaryButtonText` props.

For additional styling, like adding a prefix icon, use any available `<Button/>` props in `primaryButtonProps` and `secondaryButtonProps`.

Use the `actionsSize` prop to control the size of the primary and secondary action buttons.

```jsx
<MessageModalLayout
  onCloseButtonClick={() => {}}
  primaryButtonText="Invite All"
  primaryButtonProps={{ prefixIcon: <Icons.EmailSendSmall /> }}
  secondaryButtonText="Cancel"
  title="Invite all site members"
  content={<Text>You're about to send invites to all site members.</Text>}
/>;
```

### Developer examples

#### Mobile

On mobile, `MessageModal` maps to `Drawer` for context-sensitive confirmations (e.g., seeing what is being deleted).

When context is less important, use `ModalMobileLayout` for standalone confirmations.

_To see the change, toggle 'Enable mobile support' in the top bar of Storybook._

```jsx
() => {
  const [contextOpen, setContextOpen] = React.useState(false);
  const [confirmOpen, setConfirmOpen] = React.useState(false);
  const { mobile } = React.useContext(WixDesignSystemContext);

  const deleteTitle = 'Delete category?';
  const deleteContent =
    "You're about to delete the Yoga category. Posts inside this category will also be deleted.";

  const confirmTitle = 'Move 3 products?';
  const confirmContent =
    'You will change the location of the products. Once moved, the products will be found in New products category.';

  return (
    <Box gap="12px">
      <Button skin="destructive" onClick={() => setContextOpen(true)}>
        Context is important
      </Button>
      <Button onClick={() => setConfirmOpen(true)}>
        Standalone confirmation
      </Button>

      {/* First modal: Drawer on mobile, MessageModalLayout on desktop */}
      {mobile ? (
        <Drawer
          open={contextOpen}
          onClose={() => setContextOpen(false)}
          dismissible={false}
        >
          <Box direction="vertical" gap="SP4" padding="24px">
            <Heading size="small">{deleteTitle}</Heading>
            <Text>{deleteContent}</Text>
            <Box direction="vertical" gap="SP2">
              <Button
                skin="destructive"
                onClick={() => setContextOpen(false)}
                fullWidth
              >
                Delete
              </Button>
              <Button
                priority="secondary"
                onClick={() => setContextOpen(false)}
                fullWidth
              >
                Cancel
              </Button>
            </Box>
          </Box>
        </Drawer>
      ) : (
        <Modal
          isOpen={contextOpen}
          onRequestClose={() => setContextOpen(false)}
          shouldCloseOnOverlayClick
        >
          <MessageModalLayout
            theme="destructive"
            title={deleteTitle}
            primaryButtonText="Delete"
            primaryButtonOnClick={() => setContextOpen(false)}
            secondaryButtonText="Cancel"
            secondaryButtonOnClick={() => setContextOpen(false)}
            onCloseButtonClick={() => setContextOpen(false)}
          >
            <Text>{deleteContent}</Text>
          </MessageModalLayout>
        </Modal>
      )}

      {/* Second modal: ModalMobileLayout on mobile, MessageModalLayout on desktop */}
      {mobile ? (
        <Modal
          isOpen={confirmOpen}
          onRequestClose={() => setConfirmOpen(false)}
        >
          <ModalMobileLayout
            title={<Text weight="bold">{confirmTitle}</Text>}
            onCloseButtonClick={() => setConfirmOpen(false)}
            content={<Text>{confirmContent}</Text>}
            footer={
              <Box direction="vertical" gap="SP2">
                <Button onClick={() => setConfirmOpen(false)} fullWidth>
                  Confirm
                </Button>
                <Button
                  priority="secondary"
                  onClick={() => setConfirmOpen(false)}
                  fullWidth
                >
                  Cancel
                </Button>
              </Box>
            }
          />
        </Modal>
      ) : (
        <Modal
          isOpen={confirmOpen}
          onRequestClose={() => setConfirmOpen(false)}
          shouldCloseOnOverlayClick
        >
          <MessageModalLayout
            title={confirmTitle}
            primaryButtonText="Confirm"
            primaryButtonOnClick={() => setConfirmOpen(false)}
            secondaryButtonText="Cancel"
            secondaryButtonOnClick={() => setConfirmOpen(false)}
            onCloseButtonClick={() => setConfirmOpen(false)}
          >
            <Text>{confirmContent}</Text>
          </MessageModalLayout>
        </Modal>
      )}
    </Box>
  );
};
```

### Common use case examples

#### Warn about destructive changes

Use the `destructive` theme to bring more attention to modals that confirm irreversible actions.

Use the [`<Text/>`](https://wix-pages.com/design-system-documentation/#/component/text) component props to style the modal content.

```jsx
<MessageModalLayout
  theme={'destructive'}
  onCloseButtonClick={() => {}}
  primaryButtonText="Delete"
  secondaryButtonText="Cancel"
  title="Delete category?"
>
  <Text>
    You're about to delete the <b>Yoga</b> category. Posts inside this category
    will also be deleted.
  </Text>
</MessageModalLayout>;
```

#### Alert users to unsaved changes

Use a message modal to inform users that their changes won't be saved if the action is taken.

```jsx
<MessageModalLayout
  primaryButtonText="Leave Page"
  secondaryButtonText="Cancel"
  title="Leave page?"
  onCloseButtonClick={() => {}}
>
  <Text>When you leave this page, you'll lose unsaved changes.</Text>
</MessageModalLayout>;
```

#### Promote Premium features

Use the `illustration` prop to support upgrade messages. Illustrations can showcase the features available with upgrades.

```jsx
<MessageModalLayout
  onCloseButtonClick={() => {}}
  theme={'premium'}
  primaryButtonText="Upgrade"
  secondaryButtonText="Not Now"
  title="Upgrade to accept payments"
  illustration={'generic_upgrade.svg'}
>
  <Text>
    Upgrade your site to a Business Basic plan to start accepting payments.
  </Text>
</MessageModalLayout>;
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `actionsSize` | `"small" \| "tiny" \| "medium" \| "large"` | — | Determines the action buttons size. |
| `children` | `ReactNode` | — | Accepts any item as a child element. For all common cases pass a standard text string. |
| `closeButtonProps` | `ModalCloseButtonProps` | — | Close button props. |
| `content` | `ReactNode` | — | Contains modal's message in its middle area. <MessageModalLayout/> children are passed as content, too. |
| `contentClassName` | `string` | — |  |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `footerClassName` | `string` | — |  |
| `footnote` | `ReactNode` | — | Renders supplementary text or other components at the bottom of the modal. |
| `footnoteClassName` | `string` | — |  |
| `footnoteSkin` | `"light" \| "neutral"` | — | Sets the look and feel of the footnote. |
| `headerClassName` | `string` | — |  |
| `helpButtonProps` | `ModalControlButtonProps` | — | Help button props. |
| `illustration` | `ReactNode` | — | Contains a 120x120 px illustration at the left side of the modal. |
| `illustrationClassName` | `string` | — |  |
| `onCloseButtonClick` | `MouseEventHandler` | — |  |
| `onHelpButtonClick` | `MouseEventHandler` | — |  |
| `primaryButtonOnClick` | `() => void` | — | Defines a call-back function after user clicks on the primary button. |
| `primaryButtonProps` | `Omit<ButtonProps, "internalDataHook">` | — | Passes on any \<Button/\> properties on the primary button. |
| `primaryButtonText` | `ReactNode` | — | Sets text label for the primary button. |
| `primaryButtonTooltipProps` | `Omit<TooltipProps, "children">` | — |  |
| `secondaryButtonOnClick` | `() => void` | — | Defines a call-back function after user clicks on the secondary button. |
| `secondaryButtonProps` | `Omit<ButtonProps, "internalDataHook">` | — | Passes on any \<Button/\> properties on the secondary button. |
| `secondaryButtonText` | `ReactNode` | — | Sets text label for the secondary button. |
| `sideActions` | `ReactNode` | — | Contains a checkbox or other components at the start of the footer. |
| `skin` | `"standard" \| "destructive" \| "premium"` | — | a global skin for the modal, will affect footer buttons skin. |
| `style` | `CSSProperties` | — |  |
| `subtitle` | `ReactNode` | — | Sets text subtitle for the modal; can be used in conjunction with other components. |
| `theme` | `"standard" \| "destructive" \| "premium"` | — | Controls the skin of the modal when `skin` isn't set. |
| `title` | `ReactNode` | — | Sets text title for the modal; can be used in conjunction with other components. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `getTheme` | Gets the modal theme |
| `getSkin` | Gets the modal skin |
| `clickCloseButton` | Clicks the modal close-button |
| `clickHelpButton` | Clicks the modal help-button |
| `childExists` | Checks whether a node with the provided dataHook exists |
| `getTitleText` | Gets the title's text |
| `getSubtitleText` | Gets the subtitle's text |
| `secondaryButtonDriver` | Gets the secondary button driver |
| `getSecondaryButtonDriver` | Gets the secondary button driver |
| `primaryButtonDriver` | Gets the primary button driver |
| `getPrimaryButtonDriver` | Gets the primary button driver |
| `getPrimaryButtonTooltipContent` | Gets the primary button's tooltip content |
| `getIllustrationSrc` | Gets the illustration source |
| `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.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) — fix: the help and close buttons in the top corner are spaced as designed again in Harmony (odeditor), Studio 2.0 (odeditor-dark) and Studio 2.0 Light (studio2-light). ([#17314](invalid-url))
- **1.330.1** (2026-09-28) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — 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.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.324.0** (2026-09-14) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.308.0** (2026-08-04) — maintenance release, no component-specific changes
- **1.305.1** (2026-07-30) — maintenance release, no component-specific changes
- **1.305.0** (2026-07-28) — maintenance release, no component-specific changes
- **1.303.0** (2026-07-23) — maintenance release, no component-specific changes
- **1.299.0** (2026-07-17) — breaking: use tertiary button priority and tiny-normal footnote typography ([#16578](invalid-url)) — has visual 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.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.253.0** (2026-01-30) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.235.0** (2025-12-04) — maintenance release, no component-specific changes
- **1.214.0** (2025-08-22) — maintenance release, no component-specific changes
- **1.213.0** (2025-08-19) — maintenance release, no component-specific changes
- **1.208.0** (2025-07-25) — maintenance release, no component-specific changes
- **1.197.0** (2025-06-06) — breaking: tokenization ([#14922](invalid-url))
- **1.196.0** (2025-06-04) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.134.0** (2024-10-18) — fix: add missing types for `subtitle` prop ([#14218](invalid-url))
- **1.131.0** (2024-10-10) — fix: fix button text types ([#14196](invalid-url))
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.106.0** (2024-05-24) — maintenance release, no component-specific changes
- **1.105.0** (2024-05-21) — maintenance release, no component-specific changes
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.98.0** (2024-03-15) — maintenance release, no component-specific changes
- **1.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes