Overview
Go Headless

Changelog

Wix Design System (WDS)
Introduction
About Wix Design System
Get started developing
Get started designing
Theming
Wix Design System AI

Guidelines
Themes
Interaction & Behavior
Guidelines
Localization

Patterns
Patterns Overview
Table Pattern
Grid Switch Pattern
Grid Pattern

Foundations
Tokens and Theming basics
Icon Theming

Contributing
AI-Assisted Development
Component Structure
Contributing to Wix Design System
Creating a New Component
Creating a Pull Request
Deprecating a Component
Documenting
Fixing a Bug
Test Drivers
Contributing Tokens
Token Migration Guidelines
Updating Props
Writing Tests

Components
Actions
Animations
Charts
Feedback
Form
Layout
Lists
Mechanisms
Media
Navigation
Overlays
Drawer Component
FloatingHelper Component
FullScreenModalLayout
Modal
Modal Component
AnnouncementModalLayout Component
CustomModalLayout Component
MessageModalLayout Component
ModalMobileLayout Component
ModalPreviewLayout Component
Popover Component
PopoverMenu Component
SidePanel Component
Tooltip Component
Panels
Typography
In This Article

  1. Overview
  2. Code
  3. Testkit
  4. Changelog

ModalPreviewLayout

Components/Overlays/Modal

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

Overview

Copy

Modal preview layout displays files, such as images, videos or PDFs, inside a <Modal/> overlay. Its header strip holds a title, actions and a close button, and previous and next buttons let users move between several items.

Do

  • Use it to preview files, such as images, videos or PDFs.
  • Add actions users can take on the file, such as print or download, to the header.
  • Use the previous and next buttons to let users browse several files in one modal.

Don't

  • Don't use it for forms or other custom content. Use <CustomModalLayout/> instead.
  • Don't use it to confirm actions or show short messages. Use <MessageModalLayout/> instead.

Feature examples

Example with Full-Width Content

An example for preview layout modal with title, actions and content that takes the full width

Copy

Example with Scrollable Content

An example for preview layout modal with title, actions and content that overflows the height

Copy

Example with Multiple Content

An example for preview layout modal with title, actions and multiple content

Copy

Example with Light Skin

An example for preview layout modal with light skin

Copy

Code

Copy

Props

NameTypeDefaultDescription
actionsReactNode—Accepts any content to render in the header strip, such as actions relevant to the displayed content.
children (required)ReactNode—Accepts the content to display in the middle of the screen. When multiple children are passed, one is shown at a time with previous and next buttons to navigate between them.
closeButtonAriaLabelstring—ARIA label for close button.
closeButtonTooltipTextstring—Tooltip close button text.
dataHookstring—Applied as data-hook HTML attribute that can be used in the tests.
nextButtonPropsNextButtonProps—Next button props ##### onClick signature: function(childIndexDisplayed: number) => void * childIndexDisplayed: the index of the child component displayed.
onClose (required)() => void—Defines a callback function which is called when the close button is clicked, or when the overlay is clicked and shouldCloseOnOverlayClick is true.
prevButtonPropsPrevButtonProps—Previous button props ##### onClick signature: function(childIndexDisplayed: number) => void * childIndexDisplayed: the index of the child component displayed.
shouldCloseOnOverlayClickbooleantrueSpecifies whether clicking the overlay calls onClose.
skin"light" | "dark"'dark'Controls the skin of the component.
startDisplayingAtChildIndexnumber0Pass an index to start rendering from a specific child component.
titlestring—Sets the title text displayed in the header strip. Long titles are truncated with an ellipsis.

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
clickOverlayClick the overlay
getPreviewTitleGet the title node
getPreviewActionsGet the actions node
getPreviewContentGet the content node
clickCloseClick the close button
getCurrentChildIndexGet the index of the rendered child
getSkinGet skin
existsChecks whether the component found with the given data hook.
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

  • 1.340.0 (2026-10-21) — maintenance release, no component-specific changes
  • 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.330.0 (2026-09-28) — maintenance release, no component-specific changes
  • 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.322.0 (2026-09-09) — maintenance release, no component-specific changes
  • 1.317.0 (2026-08-26) — maintenance release, no component-specific 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.289.0 (2026-06-17) — maintenance release, no component-specific changes
  • 1.267.0 (2026-04-09) — maintenance release, no component-specific changes
  • 1.266.0 (2026-04-07) — maintenance release, no component-specific changes
  • 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
  • 1.250.0 (2026-01-27) — maintenance release, no component-specific changes
  • 1.247.2 (2026-01-21) — maintenance release, no component-specific changes
  • 1.243.0 (2025-12-23) — feat: add aria-label for close button (#15705)
  • 1.169.0 (2025-03-10) — maintenance release, no component-specific changes
  • 1.102.0 (2024-04-16) — 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

Last updated: 22 October 2026

Did this help?