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

## Article: SocialPostPreview Component

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

## Article Content:

# SocialPostPreview

_Components/Media/Preview/SocialPostPreview_

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

## Overview

```jsx
<StorybookComponents.Stack width={420}>
  <SocialPostPreview
    skin="facebook"
    caption={
      <>
        Good morning from our Restaurant! <a>#breakfast</a> <a>#toast</a>{' '}
        <a>#breakfastmenu</a>
        <br />
        <a>http://wix.to/xlTHfsQ</a>
      </>
    }
    media={
      <Image borderRadius="0px" height={330} src="https://bit.ly/3fhxPsU" />
    }
    profileName="Jane Doe Restaurant"
    profileImageSrc="https://bit.ly/2S1oL3q"
  />
</StorybookComponents.Stack>;
```

Social Post Preview allows users to preview a post they are about to publish on Facebook or Instagram.

### Do

- Use it when site owners need to preview how their social media post will be displayed specifically on Facebook or Instagram.
- Use it to visualize real-time changes in post content.

### Don't

- Don't use it to illustrate how content appears on social media platforms other than Instagram or Facebook. Use `<SocialPreview/>` instead.
- 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 display how a webpage appears on Google search results (use `<GooglePreview/>` instead).

### Feature examples

#### Structure

Social post preview consists of these content areas:\
 - Profile image that represents the user's social media account. Add image URL with \`profileImageSrc\` prop.\
 - \`profileName\` - username in Facebook or Instagram.\
 - \`caption\` - textual content of the post, including plain text, hashtags and links.\
 - \`media\` - visual content of the post.\
\
Note that \`profileName\`, \`caption\`, and \`media\` containers are nodes, i.e., they accept any components as their children.

```jsx
<SocialPostPreview
  skin="facebook"
  caption={
    <>
      Caption text! <a>#hashtag</a>
      <br />
      <a>http://link.com</a>
    </>
  }
  media={
    <StorybookComponents.Placeholder height={330}>
      Media container
    </StorybookComponents.Placeholder>
  }
  profileName="Profile Name"
/>;
```

#### Skin

Control the appearance and purpose of the component using \`skin\` prop.\
 - \`facebook\` (default) - visualizes content as posted on Facebook.\
 - \`instagram\` - visualizes content as posted on Instagram.

```jsx
<StorybookComponents.Stack>
  <SocialPostPreview
    skin="facebook"
    caption={
      <>
        Facebook skin <a>#hashtag</a>
        <br />
        <a>http://link.com</a>
      </>
    }
    media={
      <StorybookComponents.Placeholder height={330}>
        Media container
      </StorybookComponents.Placeholder>
    }
    profileName="Profile Name"
  />
  <SocialPostPreview
    skin="instagram"
    caption={
      <>
        Instagram skin <a>#hashtag</a>
      </>
    }
    media={
      <StorybookComponents.Placeholder height={330}>
        Media container
      </StorybookComponents.Placeholder>
    }
    profileName="Profile Name"
  />
</StorybookComponents.Stack>;
```

#### Caption

Add a message to the post with `caption` prop.

Use standard `<a>` and `<br>` tags to format post hashtags and links (see `<Text/>` story for more guidance).

Note that a link can only be added for posts on Facebook (`skin='facebook'`).

```jsx
<SocialPostPreview
  skin="facebook"
  caption={
    <>
      This is plain text{' '}
      <a>
        #hashtag_with_
        <a />
        _tag
      </a>
      <br />
      <a>http://link.com</a>
    </>
  }
  media={
    <StorybookComponents.Placeholder height={330}>
      Media container
    </StorybookComponents.Placeholder>
  }
  profileName="Profile Name"
/>;
```

#### Media

Include visual content for a post by adding an `<Image/>` component to the \`media\` container.

```jsx
<SocialPostPreview
  skin="facebook"
  caption={
    <>
      Caption text! <a>#hashtag</a>
      <br />
      <a>http://link.com</a>
    </>
  }
  media={<Image src="https://bit.ly/3bzJvGn" borderRadius="0px" />}
  profileName="Profile Name"
/>;
```

### Common use case examples

#### Preview before Publishing a Social Post

Add the component next to the form where users edit their Facebook or Instagram post content.

```jsx
() => {
  const initialState = {
    caption:
      'Serving you on the desert now. Come join us in the Summer Festival!',
    hashtags: ['#anywhere', '#janedoe'],
  };

  const accounts = [
    {
      id: 0,
      displayName: 'Jane Doe Restaurant',
      avatarUrl: 'https://bit.ly/2S1oL3q',
    },
    { id: 1, displayName: 'JD Dinner', avatarUrl: 'https://bit.ly/2S0T1LM' },
  ];
  const sitePages = ['/Home Page', '/Lunch Menu', '/Dinner Menu'];
  const imageUrl = 'https://bit.ly/3uWKs3c';
  const [selectedAccount, setSelectedAccount] = React.useState(accounts[0]);
  const [caption, setCaption] = React.useState(initialState.caption);
  const [hashtags, setHashtags] = React.useState(initialState.hashtags);
  const [linkedPage, setLinkedPage] = React.useState(sitePages[0]);
  const links = [
    'http://wix.to/xlGkrTl',
    'http://wix.to/xlXsfYx',
    'http://wix.to/zyGtbTk',
  ];
  const [linkToPage, setLinkToPage] = React.useState(links[0]);

  const renderAccountLabel = (account) => (
    <Box verticalAlign="middle">
      <Avatar
        imgProps={{
          src: account.avatarUrl,
        }}
        size="size30"
      />
      <Box marginLeft={2} maxWidth={180}>
        <Text
          size="medium"
          ellipsis
          showTooltip={false}
          light={account.id === selectedAccount.id}
        >
          {account.displayName}
        </Text>
      </Box>
    </Box>
  );

  const renderCardHeader = () => (
    <Box gap={1} paddingLeft={4} paddingTop={3} paddingBottom={3}>
      <Box color="blue">
        <Icons.Facebook />
      </Box>
      <DropdownBase
        maxWidth={288}
        options={accounts.map((account) => ({
          id: account.id,
          value: renderAccountLabel(account),
        }))}
        selectedId={selectedAccount.id}
        onSelect={({ id }) => {
          setSelectedAccount(accounts.find((account) => account.id === id));
        }}
      >
        {({ toggle }) => (
          <Box>
            <TextButton
              onClick={toggle}
              skin="dark"
              weight="normal"
              suffixIcon={<Icons.ChevronDown />}
            >
              {selectedAccount.displayName}
            </TextButton>
          </Box>
        )}
      </DropdownBase>
    </Box>
  );

  const renderRadioGroup = () => (
    <FormField label="When:">
      <RadioGroup value="0" disabledRadios={['1']}>
        <RadioGroup.Radio value="0">
          <Text size="medium" weight="thin">
            Now
          </Text>
        </RadioGroup.Radio>
        <RadioGroup.Radio value="1">
          <Text size="medium" weight="thin" skin="disabled">
            {'Schedule '}
          </Text>
          <TextButton
            size="medium"
            weight="thin"
            skin="premium"
            underline="always"
          >
            Upgrade Ascend
          </TextButton>
        </RadioGroup.Radio>
      </RadioGroup>
    </FormField>
  );

  const renderSmallImage = () => (
    <FormField label="Image">
      <Image width={84} height={84} src={imageUrl} />
    </FormField>
  );

  const renderCaption = () => (
    <Box direction="vertical" width="100%">
      <FormField label="Caption">
        <InputArea
          value={caption}
          onChange={(e) => setCaption(e.target.value)}
          size="medium"
        />
      </FormField>
    </Box>
  );

  const renderHashtags = () => (
    <Box direction="vertical" width="100%">
      <FormField label="Hashtags">
        <MultiSelect
          tags={hashtags.map((hashtag, index) => ({
            id: index.toString(),
            label: hashtag,
          }))}
          size="medium"
          onManuallyInput={(hash) => setHashtags(hashtags.concat(hash))}
          onRemoveTag={(index) =>
            setHashtags(
              hashtags.filter((_, _index) => index !== _index.toString()),
            )
          }
        />
      </FormField>
    </Box>
  );

  const renderLinkedPage = () => (
    <Box direction="vertical" width="100%">
      <FormField label="Linked Page">
        <AutoComplete
          options={sitePages.map((page, index) => ({
            id: index,
            value: page,
          }))}
          value={linkedPage}
          onSelect={(selectedIndex) => {
            setLinkedPage(String(selectedIndex.value));
            setLinkToPage(links[selectedIndex.id]);
          }}
        />
      </FormField>
    </Box>
  );

  const renderShareForm = () => (
    <Box direction="vertical" gap={4} padding={4} align="left" width="60%">
      {renderRadioGroup()}
      {renderSmallImage()}
      {renderCaption()}
      {renderHashtags()}
      {renderLinkedPage()}
    </Box>
  );

  return (
    <Card>
      {renderCardHeader()}
      <Card.Divider />
      <Box width="100%">
        {renderShareForm()}
        <Divider direction="vertical" />
        <Box
          direction="vertical"
          backgroundColor={'rgba(135, 135, 135, 0.05)'}
          gap={1}
          paddingTop={4}
          paddingLeft={5}
          paddingRight={5}
          width="40%"
        >
          <FormField
            label="Preview"
            infoContent="This is how your post will look like on Facebook"
          >
            <SocialPostPreview
              skin="facebook"
              profileName={selectedAccount.displayName}
              profileImageSrc={selectedAccount.avatarUrl}
              caption={
                <>
                  {caption.length > 0 && (
                    <>
                      {caption}
                      <br />
                    </>
                  )}
                  {hashtags.length > 0 && (
                    <>
                      <a>{hashtags.join(' ')}</a>
                      <br />
                    </>
                  )}
                  <a>{linkToPage}</a>
                </>
              }
              media={<Image src={imageUrl} borderRadius="0px" />}
            />
          </FormField>
        </Box>
      </Box>
    </Card>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `caption` | `ReactNode` | — | Adds textual post content. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `media` | `ReactNode` | — | Adds visual post content (most commonly, <Image/> is added as a child item) |
| `profileImageSrc` | `string` | — | Contains a URL link to the post's profile picture. |
| `profileName` | `ReactNode` | — | Contains the post's profile name (a username in Facebook or Instagram) |
| `skin` | `"facebook" \| "instagram"` | — | Controls the appearance and layout of the component. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `getSkin` | Returns skin value |
| `getCaption` | Returns caption value |
| `getProfileName` | Returns profile name value |
| `getProfileImageSrc` | Returns profile image source value |
| `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.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.295.0** (2026-07-03) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — 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.212.0** (2025-08-11) — 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