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

## Article: PreviewWidget Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/media/browser-preview-widget/preview-widget-component.md

## Article Content:

# PreviewWidget

_Components/Media/Preview/PreviewWidget_

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

## Overview

```jsx
() => {
  return (
    <StorybookComponents.Stack flexDirection="column">
      <PreviewWidget>
        <Box
          backgroundColor="D80"
          direction="vertical"
          gap="2"
          padding="24px"
          align="center"
        >
          <Heading size="small">Thank you! See you soon</Heading>
          <Text size="small">
            An Email with the event's details was sent to you
          </Text>
          <Button size="small">Add to Calendar</Button>
          <TextButton size="small">Share</TextButton>
        </Box>
      </PreviewWidget>
    </StorybookComponents.Stack>
  );
};
```

Preview widget allows users to preview how content appears on a separate window. It is often used to illustrate how designs look on the web, without putting it into the frames of specific devices.

### Do

- Use it to illustrate how content (website, design, etc.) appears on the web.

### Don't

- Don't use it to illustrate how content appears on a browser. Use `<BrowserPreviewWidget/>` instead.
- Don't use it to illustrate how content appears on a mobile device. Use `<MobilePreviewWidget/>` instead.
- Don't use it to preview what information will be displayed when users share a specific URL on a social media platform. Use `<SocialPreview/>` instead.

### Feature examples

#### Structure

Preview widget consists of a preview content area placed on a background that emphasises it.\
Preview content area is an empty container that accepts any kind of content (text, image or other) as a child item.

```jsx
<PreviewWidget>
  <StorybookComponents.Placeholder width="300px" height="120px">
    Preview content area
  </StorybookComponents.Placeholder>
</PreviewWidget>;
```

#### Skin

Change the color of the background with \`skin\` and \`backgroundColor\` props. It supports 3 skins:\
 - \`neutral\` (default) - use in all common cases.\
 - \`gradient\` - use for larger preview areas.\
 - \`custom\` - use it to specify a custom background color. Use a \`backgroundColor\` prop to set the exact background color value from [WSR system colors](#).

```jsx
<StorybookComponents.Stack flexDirection="column">
  <PreviewWidget>
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Neutral (default) background</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget skin="gradient">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Gradient background</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget skin="custom" backgroundColor="B10">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Custom background, backgroundColor prop is set to "Y30"</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
</StorybookComponents.Stack>;
```

#### Content Outline

Change the content outline with \`contentOutline\` prop. It supports 3 options:\
 - \`shadow\` (default).\
 - \`border\` - use it to frame the content area with a gray 1px border.\
 - \`none\` - use it to display the content area without an outline.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <PreviewWidget skin="neutral">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Shadow (default) outline</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget skin="neutral" contentOutline="border">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Border outline</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget skin="neutral" contentOutline="none">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>No outline</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
</StorybookComponents.Stack>;
```

#### Dimensions

Control the dimensions of the component using \`height\` and \`width\` props. Both \`width\` and \`height\` can be set to custom value in % or px.\
Default value for \`width\` is 100%, while \`height\` is \`auto\` - component height adjusts to the height of content in the content area.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <PreviewWidget width="100%">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>Auto (default) height, 100% width</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget height="100px" width="50%">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>100 px height, 50% width</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
  <PreviewWidget height="120px" width="75%">
    <StorybookComponents.Background skin="yellow">
      <StorybookComponents.Stack padding="20px">
        <Text>120 px height, 75% width</Text>
      </StorybookComponents.Stack>
    </StorybookComponents.Background>
  </PreviewWidget>
</StorybookComponents.Stack>;
```

#### Scrollable Content

Support scroll for overflowed content with \`scrollable\` prop. Default value for \`scrollable\` is \`false\`.

```jsx
<PreviewWidget scrollable height="200px">
  <StorybookComponents.Background skin="yellow">
    <StorybookComponents.Stack padding="20px">
      <Text>
        This is a very long text that overflows the height of the content area.
        <br></br>
        Therefore, a <b>scrollbar</b> appears on the right.<br></br>
        Use this prop to display a long content or designs by setting <br></br>
        scrollable height to necessary height in px.<br></br>
        In this case, scrollable height is 200 px.<br></br>
        You need to scroll to see the rest of the content below 200 px
        <br></br>
        content area.
      </Text>
    </StorybookComponents.Stack>
  </StorybookComponents.Background>
</PreviewWidget>;
```

### Common use case examples

#### Design Previews

Preview widget lets the users preview their website designs / templates / other content on a separate mock window.

```jsx
() => {
  const [selected, setSelected] = React.useState('1');
  const handleClick = (_, value) => setSelected(value);

  return (
    <Card controls={<CloseButton size="medium" />}>
      <Box backgroundColor="D80" height="680px">
        <Layout>
          <Cell span={6}>
            {selected === '1' && (
              <PreviewWidget height="100%" contentOutline="none">
                <Image height="500px" src="PreviewWidgetExample.png" />
              </PreviewWidget>
            )}
            {selected === '2' && (
              <MobilePreviewWidget>
                <Box align="center" verticalAlign="middle" height="100%">
                  <Image
                    height="100%"
                    src="PreviewWidgetExample.png"
                    borderRadius={0}
                  />
                </Box>
              </MobilePreviewWidget>
            )}
          </Cell>
          <Cell span={6} vertical>
            <Box direction="vertical" paddingTop="24px">
              <Box paddingLeft="30px">
                <SegmentedToggle selected={selected} onClick={handleClick}>
                  <SegmentedToggle.Icon value="1" tooltipText="Desktop">
                    <Icons.Desktop />
                  </SegmentedToggle.Icon>
                  <SegmentedToggle.Icon value="2" tooltipText="Mobile">
                    <Icons.Mobile />
                  </SegmentedToggle.Icon>
                </SegmentedToggle>
              </Box>
              <MarketingLayout
                title="Promote a workshop"
                description="Learning online is a trend. Let people know about your courses. Tell them what will they learn and how to register."
                actions={<Button size="small">Use this template</Button>}
              />
            </Box>
          </Cell>
        </Layout>
      </Box>
    </Card>
  );
};
```

#### Settings Previews

The component illustrates how content looks like on the website while changing its settings in real-time.

```jsx
() => {
  const [planName, setPlanName] = React.useState('Golden Plan');
  const [tagLine, setTagLine] = React.useState('Perfect for advanced players');
  const [planInclusion, setPlanInclusion] = React.useState('Unlimited classes');
  return (
    <Page>
      <Page.Header
        title={planName}
        actionsBar={
          <Box gap="SP2">
            <Button skin="inverted">Cancel</Button>
            <Button>Save</Button>
          </Box>
        }
        breadcrumbs={
          <Breadcrumbs
            activeId="3"
            items={[
              { id: '1', value: 'Pricing Plans' },
              { id: '2', value: planName },
            ]}
          />
        }
        showBackButton
        onBackClicked={() => {}}
      />
      <Page.Content>
        <Layout>
          <Cell span={7}>
            <Card>
              <Card.Header
                title="Plan Info"
                subtitle="Start by giving your plan a name and sum up what it’s about with a tagline."
              />
              <Card.Divider />
              <Card.Content>
                <Layout>
                  <Cell>
                    <FormField labelSize="small" required label="Plan Name">
                      <Input
                        placeholder="e.g., Silver Plan"
                        value={planName}
                        onChange={(e) => setPlanName(e.target.value)}
                      />
                    </FormField>
                  </Cell>
                  <Cell>
                    <FormField labelSize="small" label="Tagline (optional)">
                      <Input
                        placeholder="e.g., Perfect for beginners"
                        value={tagLine}
                        onChange={(e) => setTagLine(e.target.value)}
                      />
                    </FormField>
                  </Cell>
                  <Cell>
                    <Divider />
                  </Cell>
                  <Cell>
                    <FormField
                      labelSize="small"
                      label="List what's included in this plan"
                    >
                      <Input
                        placeholder="e.g., Unlimited yoga classes"
                        value={planInclusion}
                        onChange={(e) => setPlanInclusion(e.target.value)}
                      />
                    </FormField>
                  </Cell>
                  <Cell>
                    <Box align="center">
                      <TextButton size="small" prefixIcon={<Icons.AddSmall />}>
                        Add More
                      </TextButton>
                    </Box>
                  </Cell>
                </Layout>
              </Card.Content>
            </Card>
          </Cell>
          <Cell span={5}>
            <Card>
              <Card.Header
                title="Plan Preview"
                subtitle="See how your plan will appear online."
              />
              <PreviewWidget skin="gradient">
                <Box backgroundColor="D80">
                  <Layout justifyItems="center">
                    <Cell>
                      <Box paddingTop={4}>
                        <Heading size="medium">{planName}</Heading>
                      </Box>
                    </Cell>
                    <Cell>
                      <Box direction="vertical" align="center">
                        <Heading size="extraLarge">€ 45</Heading>
                        <Text size="small">Every month</Text>
                      </Box>
                    </Cell>
                    <Cell>
                      <Text size="small">{tagLine}</Text>
                    </Cell>
                    <Cell>
                      <Button size="small">Select</Button>
                    </Cell>
                    {planInclusion && (
                      <Cell>
                        <Box width="200px">
                          <Divider />
                        </Box>
                      </Cell>
                    )}
                    <Cell span={12}>
                      <Box paddingBottom="24px">
                        <Text size="small">{planInclusion}</Text>
                      </Box>
                    </Cell>
                  </Layout>
                </Box>
              </PreviewWidget>
            </Card>
          </Cell>
        </Layout>
      </Page.Content>
    </Page>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `backgroundColor` | `string` | — | Sets the content area background color, as a HEX code. Accepts custom colors from the Wix Design System color palette. |
| `children` *(required)* | `ReactNode` | — | Sets the main preview content. Accepts an image, text paragraph or any other custom element. |
| `contentOutline` | `"border" \| "none" \| "shadow"` | `'shadow'` | Sets the content outline as `shadow` (default), `border` or `none` |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `height` | `string` | `'auto'` | Adjusts the height of the component or can be set in specific % or px. |
| `scrollable` | `boolean` | `false` | Enables vertical scroll of the overflowed content *. |
| `skin` | `"neutral" \| "gradient" \| "custom"` | `'neutral'` | Sets the color of the content area background (`neutral` or `gradient`). To use custom skin color, set it to `custom` and use the `backgroundColor` prop. |
| `width` | `string` | `'100%'` | Sets the width of the component in % or px. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `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.330.0** (2026-09-28) — 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.320.0** (2026-09-03) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.295.0** (2026-07-03) — 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.289.0** (2026-06-17) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.263.0** (2026-03-31) — fix: fix gradient in token themes ([#15913](invalid-url)) — has visual 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.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes