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

## Article: BrowserPreviewWidget Component

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

## Article Content:

# BrowserPreviewWidget

_Components/Media/Preview_

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

## Overview

```jsx
<BrowserPreviewWidget browserBarSize="size12">
  <Image
    width="320px"
    height="180px"
    borderRadius="0"
    src="browserPreview.png"
  />
</BrowserPreviewWidget>;
```

Browser preview widget enables users to see how their site will look like when opened in a web browser.

### Do

- Use it to show how a user's site or other content will appear in a web browser.
- Use it to show how user-controlled settings look like in a published website.

### Don't

- Don't use it to preview content on mobile devices (use `<MobilePreviewWidget/>` instead).
- Don't use it to show how a website's URL appears on social media (use `<SocialPreview/>` or `<SocialPostPreview/>` instead).
- Don't use it to show how a site appears on Google search results (use `<GooglePreview/>` instead).

### Feature examples

#### Structure

Component consists of preview content area and a browser bar:

- Preview content area displays any type of content, like an image, text, or video. Add it inside the component as its `children`.
- A styled browser bar is added at the top by default.

```jsx
<BrowserPreviewWidget>
  <StorybookComponents.Placeholder width="320px" height="120px">
    <Box verticalAlign="middle" align="center" height="100%">
      <Text>Preview content area</Text>
    </Box>
  </StorybookComponents.Placeholder>
</BrowserPreviewWidget>;
```

#### Skin

Change the background style with `skin` prop:

- Use `neutral` (default) in all common cases.
- Use `gradient` for larger preview areas.
- Use `custom` to set the `backgroundColor` to any color using design system color tokens, RGB or HEX formats.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <BrowserPreviewWidget skin="neutral">
    <StorybookComponents.Placeholder width="320px" height="120px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Neutral</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget skin="gradient">
    <StorybookComponents.Placeholder width="320px" height="120px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Gradient</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget skin="custom" backgroundColor="B40">
    <StorybookComponents.Placeholder width="320px" height="120px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Custom background</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
</StorybookComponents.Stack>;
```

#### Browser bar size

Control the height of the browser bar with `browserBarSize` prop, depending on the preview area width:

- Use `size9` when preview's width is <312 px.
- Use `size12` (default) when width is 312–443 px.
- Use `size18` when width is 444–660 px.
- Use `size24` when width is >660 px.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <BrowserPreviewWidget browserBarSize="size9">
    <StorybookComponents.Placeholder width="240px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Shorter than 312 px</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget browserBarSize="size12">
    <StorybookComponents.Placeholder width="320px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>312–443 px wide</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget browserBarSize="size18">
    <StorybookComponents.Placeholder width="520px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>444–660 px wide</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget browserBarSize="size24">
    <StorybookComponents.Placeholder width="720px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Wider than 660 px</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
</StorybookComponents.Stack>;
```

#### Width and height

Control dimensions of the component by setting `width` and `height` props to custom % or px.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <BrowserPreviewWidget width="50%">
    <StorybookComponents.Placeholder width="240px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Custom width</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
  <BrowserPreviewWidget height="240px">
    <StorybookComponents.Placeholder width="240px" height="60px">
      <Box verticalAlign="middle" align="center" height="100%">
        <Text>Custom height</Text>
      </Box>
    </StorybookComponents.Placeholder>
  </BrowserPreviewWidget>
</StorybookComponents.Stack>;
```

### Common use case examples

#### Site previews

Use browser preview widget to showcase a design prepared by or suggested for the user.

It is often used together with `<MobilePreviewWidget/>` preview.

```jsx
() => {
  const VIEW_TYPE = {
    desktopView: 'desktopView',
    mobileView: 'mobileView',
  };
  const [viewType, setViewType] = React.useState(VIEW_TYPE.desktopView);

  const changeViewType = (_, value) => setViewType(value);

  const desktopView = () => (
    <BrowserPreviewWidget skin="gradient" height="718px">
      <Image
        width="360px"
        height="180px"
        borderRadius="0"
        src="browserPreview.png"
      />
    </BrowserPreviewWidget>
  );

  const mobileView = () => (
    <MobilePreviewWidget skin="gradient" height="718px">
      <Image height="476px" borderRadius="0" src="browserPreviewMobile.png" />
    </MobilePreviewWidget>
  );

  return (
    <CustomModalLayout
      height="720px"
      onCloseButtonClick={() => {}}
      removeContentPadding
      content={
        <Layout gap="0px">
          <Cell span={6}>
            {viewType === VIEW_TYPE.desktopView ? desktopView() : mobileView()}
          </Cell>
          <Cell span={6}>
            <Box
              direction="vertical"
              paddingLeft="24px"
              paddingRight="24px"
              gap="24px"
              verticalAlign="middle"
              height="100%"
            >
              <Box>
                <SegmentedToggle selected={viewType} onClick={changeViewType}>
                  <SegmentedToggle.Icon
                    value={VIEW_TYPE.desktopView}
                    tooltipText="Desktop"
                  >
                    <Icons.Desktop />
                  </SegmentedToggle.Icon>
                  <SegmentedToggle.Icon
                    value={VIEW_TYPE.mobileView}
                    tooltipText="Mobile"
                  >
                    <Icons.Mobile />
                  </SegmentedToggle.Icon>
                </SegmentedToggle>
              </Box>
              <Heading size="large">Your campaign is live!</Heading>
              <Box direction="vertical" gap="12px">
                <Text>
                  Be proud. Get the word out about the amazing things you're
                  doing.
                </Text>
                <TextButton prefixIcon={<Icons.Link />}>
                  Share your Campaign
                </TextButton>
              </Box>
              <Box width="100%" align="right">
                <Button priority="secondary">Done</Button>
              </Box>
            </Box>
          </Cell>
        </Layout>
      }
    />
  );
};
```

#### Selected page validation

Use browser preview widget to validate if the selected site is the one the user wants to proceed with.

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

  return (
    <CustomModalLayout
      primaryButtonText="Import Posts"
      secondaryButtonText="Cancel"
      onCloseButtonClick={() => {}}
      title="Import posts to your blog"
      content={
        <Box direction="vertical" gap="12px">
          <Text>Is this your blog?</Text>
          <Layout gap="0px">
            <Cell span={6}>
              <BrowserPreviewWidget
                skin="custom"
                backgroundColor="D80"
                browserBarSize="size9"
              >
                <Image
                  width="240px"
                  height="140px"
                  borderRadius="0"
                  src="browserPreview.png"
                />
              </BrowserPreviewWidget>
            </Cell>
            <Cell span={6}>
              <Box
                direction="vertical"
                gap="3x"
                height="100%"
                verticalAlign="middle"
              >
                <Text>Home | Wix Design System</Text>
                <TextButton>wixdesignsystem.com</TextButton>
              </Box>
            </Cell>
          </Layout>
          <Checkbox
            checked={checked}
            onChange={() => setChecked(!checked)}
            vAlign="top"
          >
            By checking the box you allow Wix to import this content, confirm
            you own or are licenced to use it and assume liability for this use
          </Checkbox>
        </Box>
      }
    />
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `backgroundColor` | `string` | — | Mobile preview widget background color. Can be set with `design system` colors. |
| `browserBarSize` | `"size24" \| "size18" \| "size9" \| "size12"` | `'size12'` | Browser bar height. |
| `children` *(required)* | `ReactNode` | — | Node to preview. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used in the tests. |
| `height` | `string` | `'100%'` | Sets the height of the component. |
| `skin` | `"neutral" \| "gradient" \| "custom"` | `'neutral'` | Background skin. To use `custom` skin, set it to `custom` and use the `backgroundColor` prop. |
| `width` | `string` | `'100%'` | Sets the width of the component. |

## Testkit

Import the driver matching your test environment:

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

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

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

// Testing Library
import { BrowserPreviewWidgetTestkit } 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.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.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.268.0** (2026-04-13) — 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.115.0** (2024-07-17) — 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