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

## Article: ModalPreviewLayout Component

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

## Article Content:

# ModalPreviewLayout

_Components/Overlays/Modal_

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

## Overview

```jsx
() => {
  const [open, setOpen] = React.useState(false);

  return (
    <StorybookComponents.Stack>
      <Button onClick={() => setOpen(true)}>Open</Button>
      <Modal isOpen={open}>
        <ModalPreviewLayout
          title="Simple Modal"
          actions={
            <Box verticalAlign="middle">
              <Box marginRight={2}>
                <TextButton
                  size="small"
                  skin="light"
                  prefixIcon={<Icons.Print />}
                >
                  Print
                </TextButton>
              </Box>
              <Box marginRight={2}>
                <Button priority="secondary" size="small" skin="light">
                  Send
                </Button>
              </Box>
              <IconButton priority="secondary" size="small" skin="light">
                <Icons.More />
              </IconButton>
            </Box>
          }
          onClose={() => setOpen(false)}
        >
          <Box
            align="center"
            verticalAlign="middle"
            backgroundColor="D80"
            padding={3}
            borderRadius={3}
          >
            This is an inner content!
          </Box>
        </ModalPreviewLayout>
      </Modal>
    </StorybookComponents.Stack>
  );
};
```

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

```jsx
() => {
  const [open, setOpen] = React.useState(false);

  return (
    <div>
      <Button onClick={() => setOpen(true)}>Open</Button>
      <Modal isOpen={open}>
        <ModalPreviewLayout
          title="Modal with Full-Width Content"
          actions={
            <Box verticalAlign="middle">
              <Box marginRight={2}>
                <TextButton
                  size="small"
                  skin="light"
                  prefixIcon={<Icons.Print />}
                >
                  Print
                </TextButton>
              </Box>
              <Box marginRight={2}>
                <Button priority="secondary" size="small" skin="light">
                  Send
                </Button>
              </Box>
              <IconButton priority="secondary" size="small" skin="light">
                <Icons.More />
              </IconButton>
            </Box>
          }
          onClose={() => setOpen(false)}
        >
          <Box verticalAlign="middle" height="100%">
            <img
              src="https://i.ibb.co/C8HHTJx/rectangle-2x.png"
              width="100%"
              height="550px"
            />
          </Box>
        </ModalPreviewLayout>
      </Modal>
    </div>
  );
};
```

#### Example with Scrollable Content

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

```jsx
() => {
  const [open, setOpen] = React.useState(false);

  return (
    <div>
      <Button onClick={() => setOpen(true)}>Open</Button>
      <Modal isOpen={open}>
        <ModalPreviewLayout
          title="Modal with Scrollable Content"
          actions={
            <Box verticalAlign="middle">
              <Box marginRight={2}>
                <TextButton
                  size="small"
                  skin="light"
                  prefixIcon={<Icons.Print />}
                >
                  Print
                </TextButton>
              </Box>
              <Box marginRight={2}>
                <Button priority="secondary" size="small" skin="light">
                  Send
                </Button>
              </Box>
              <IconButton priority="secondary" size="small" skin="light">
                <Icons.More />
              </IconButton>
            </Box>
          }
          onClose={() => setOpen(false)}
        >
          <Box
            align="center"
            verticalAlign="middle"
            backgroundColor="D80"
            padding={3}
            borderRadius={3}
            width="750px"
            height="150vh"
          >
            This is a content that overflows!
          </Box>
        </ModalPreviewLayout>
      </Modal>
    </div>
  );
};
```

#### Example with Multiple Content

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

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const prevButtonProps = {
    tooltipText: 'Previous',
    onClick: (i) => console.log('index ', i),
  };
  const nextButtonProps = {
    tooltipText: 'Next',
    onClick: (i) => console.log('index ', i),
  };
  return (
    <StorybookComponents.Stack>
      <Button onClick={() => setOpen(true)}>Open</Button>
      <Modal isOpen={open}>
        <ModalPreviewLayout
          closeButtonTooltipText="Close"
          prevButtonProps={prevButtonProps}
          nextButtonProps={nextButtonProps}
          title="Modal with Multiple Content"
          actions={
            <Box verticalAlign="middle">
              <Box marginRight={2}>
                <TextButton
                  size="small"
                  skin="light"
                  prefixIcon={<Icons.Print />}
                >
                  Print
                </TextButton>
              </Box>
              <Box marginRight={2}>
                <Button priority="secondary" size="small" skin="light">
                  Send
                </Button>
              </Box>
              <IconButton priority="secondary" size="small" skin="light">
                <Icons.More />
              </IconButton>
            </Box>
          }
          onClose={() => setOpen(false)}
        >
          {['first', 'second', 'third'].map((ordinalNum, i) => (
            <Box
              key={i}
              align="center"
              verticalAlign="middle"
              backgroundColor="D80"
              width="60vw"
              height="90vh"
              children={`This is the ${ordinalNum} page`}
            />
          ))}
        </ModalPreviewLayout>
      </Modal>
    </StorybookComponents.Stack>
  );
};
```

#### Example with Light Skin

An example for preview layout modal with light skin

```jsx
() => {
  const [open, setOpen] = React.useState(false);

  return (
    <StorybookComponents.Stack>
      <Button onClick={() => setOpen(true)}>Open</Button>
      <Modal isOpen={open}>
        <ModalPreviewLayout
          title="Simple Modal with a very long title to show off ellipsis"
          closeButtonTooltipText="Close Modal"
          skin="light"
          actions={
            <Box verticalAlign="middle">
              <Box marginRight={2}>
                <TextButton size="small" prefixIcon={<Icons.Print />}>
                  Print
                </TextButton>
              </Box>
              <Box marginRight={2}>
                <Button priority="secondary" size="small">
                  Send
                </Button>
              </Box>
              <IconButton priority="secondary" size="small">
                <Icons.More />
              </IconButton>
            </Box>
          }
          onClose={() => setOpen(false)}
        >
          <Box
            align="center"
            verticalAlign="middle"
            backgroundColor="D80"
            padding={3}
            borderRadius={3}
          >
            This is an inner content!
          </Box>
        </ModalPreviewLayout>
      </Modal>
    </StorybookComponents.Stack>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `actions` | `ReactNode` | — | 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. |
| `closeButtonAriaLabel` | `string` | — | ARIA label for close button. |
| `closeButtonTooltipText` | `string` | — | Tooltip close button text. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used in the tests. |
| `nextButtonProps` | `NextButtonProps` | — | 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`. |
| `prevButtonProps` | `PrevButtonProps` | — | Previous button props ##### onClick signature: function(childIndexDisplayed: number) => void * `childIndexDisplayed`: the index of the child component displayed. |
| `shouldCloseOnOverlayClick` | `boolean` | `true` | Specifies whether clicking the overlay calls `onClose`. |
| `skin` | `"light" \| "dark"` | `'dark'` | Controls the skin of the component. |
| `startDisplayingAtChildIndex` | `number` | `0` | Pass an index to start rendering from a specific child component. |
| `title` | `string` | — | Sets the title text displayed in the header strip. Long titles are truncated with an ellipsis. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `clickOverlay` | Click the overlay |
| `getPreviewTitle` | Get the title node |
| `getPreviewActions` | Get the actions node |
| `getPreviewContent` | Get the content node |
| `clickClose` | Click the close button |
| `getCurrentChildIndex` | Get the index of the rendered child |
| `getSkin` | Get skin |
| `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) — 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](invalid-url))
- **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