Components/Overlays/Modal
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/messagemodallayout
Message modals display short messages letting users confirm or cancel an action before moving forward. They're used inside <Modal/> overlays.
<CustomModalLayout/> instead.<ModalPreviewLayout/> instead.<ModalMobileLayout/> instead.Use different skin to set the overall look of the modal and its action buttons:
standard(default).premium.destructive .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 theonCloseButtonClick prop.
Both can be customised with closeButtonProps and helpButtonProps.
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.
Add supplementary actions in the sideActions container.
Add supplementary text and/or links into the footnote container.
Use the footnoteSkin prop to define it as neutral (default) or light.
Add short text to summarize modal content using the title prop.
Use optional subtitle prop to add secondary text below the modal title.
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.
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.
Use the destructive theme to bring more attention to modals that confirm irreversible actions.
Use the <Text/> component props to style the modal content.
Use a message modal to inform users that their changes won't be saved if the action is taken.
Use the illustration prop to support upgrade messages. Illustrations can showcase the features available with upgrades.
| 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. |
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. |
Import the driver matching your test environment:
| 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. |
subtitle prop (#14218)Last updated: 21 October 2026