Components/Media/Preview
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/googlepreview
Google preview allows users to preview how the website appears in Google search results. It is frequently used in SEO settings' panels.
<SocialPreview/> instead).Component consists of 4 content areas:
siteName - shows the title of a page at the top of the widget.previewUrl - shows the URL preview at the top of the widget.title - shows the title of the page and its keywords, as set in the SEO settings.description - shows a short description for the page, as set in the SEO settings (optional).Change the background of the widget with skin prop:
light (default) sets the background to white with gray 1 px border.transparent removes the background color and border.Limit the number of lines the title can take with titleMaxLines prop.
The default titleMaxLines value is 1.
Use description to provide more context about a site.
Truncate the description after a certain number of lines with descriptionMaxLines prop.
The default descriptionMaxLines value is 2.
Use Google preview to visualise SEO settings impact on user website appearance in Google search results.
| Name | Type | Default | Description |
|---|---|---|---|
dataHook | string | — | Applies a data-hook HTML attribute to be used in the tests. |
description | string | — | Sets a short description for the page. |
descriptionMaxLines | number | 2 | Truncates description text at a specific number of lines. |
favicon | string | — | Specifies an URL link to favicon source. If not provided, a fallback favicon is displayed. |
onDescriptionClick | MouseEventHandler | — | Callback function triggered when description is clicked. |
onDescriptionMouseEnter | MouseEventHandler | — | Defines a callback function which is called when cursor enters the description. |
onDescriptionMouseLeave | MouseEventHandler | — | Defines a callback function which is called when cursor leaves the description. |
onTitleClick | MouseEventHandler | — | Callback function triggered when title is clicked. |
onTitleMouseEnter | MouseEventHandler | — | Defines a callback function which is called when cursor enters the title. |
onTitleMouseLeave | MouseEventHandler | — | Defines a callback function which is called when cursor leaves the title. |
onWebsiteInfoClick | MouseEventHandler | — | Callback function triggered when website info section (favicon, site name and preview URL) is clicked. |
previewUrl | string | — | Sets the link for the site. |
siteName | string | — | Sets the site name of the website. |
skin | "light" | "transparent" | — | Sets widget background color. |
title | string | — | Sets the title of the page. |
titleMaxLines | number | 1 | Truncates title text at a specific number of lines. |
websiteInfoTooltipContent | ReactNode | — | When provided, a tooltip is displayed on website info section (favicon, site name and preview URL) hover. |
websiteInfoTooltipProps | Partial<TooltipCommonProps> | — | Allows to pass tooltip common props to website info tooltip. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
getPreviewUrl | Get the current count |
getTitle | Click the button |
getDescription | Get the button's text |
getSiteName | Get site name |
titleMouseEnter | Triggers title mouse enter |
titleMouseLeave | Triggers title mouse leave |
descriptionMouseEnter | Triggers description mouse enter |
descriptionMouseLeave | Triggers description mouse leave |
clickWebsiteInfo | Clicks on the website info section |
clickTitle | Clicks the title |
clickDescription | Clicks the description |
isWebsiteInfoTooltipEnabled | Returns true if website info section has a tooltip |
isWebsiteInfoTooltipExists | Returns true if website info section tooltip exists on the DOM |
getWebsiteInfoTooltipContent | Returns content of website info section tooltip |
websiteInfoTooltipMouseEnter | Triggers tooltip mouse enter |
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. |
Last updated: 22 October 2026