Wrap the page in LinkPreviewProvider with your adapter, then compose each LinkPreview with its parts.
shared-links.tsx
LinkPreview
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | — | The address. Only http: and https: links render as a link; any other shows as text. |
| variant | "card" | The look: card (text and a picture at the end), stacked, compact, or inline. | |
| data | — | The preview when the app has it already (null: the page has no preview). Leave it out to read it through the LinkPreviewProvider adapter. | |
| status | "empty""error""loading""ready" | — | The load state, when the app owns it (a story, a server render). Default: from the data. |
| labels | — | The words the item writes itself. | |
| children | ReactNode | — | The parts. Default: the card of the variant (LinkPreviewCard). |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
LinkPreviewCard
<a>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. |
LinkPreviewContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
LinkPreviewImage
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
LinkPreviewSite
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
LinkPreviewTitle
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
LinkPreviewDescription
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
LinkPreviewMeta
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
LinkPreviewFallback
<a>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. |
LinkPreviewError
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
LinkPreviewRetry
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "default" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "outline" | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
LinkPreviewHover
| Prop | Type | Default | Description | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| href | string | — | The address the text link opens and the card previews. | |||||||||||||||||||||||
| data | — | The preview when the app has it already; else the provider adapter reads it on open. | ||||||||||||||||||||||||
| children | ReactNode | — | The trigger and the card: LinkPreviewHoverTrigger and LinkPreviewHoverContent. | |||||||||||||||||||||||
From Base UIPreviewCard.RootBase UI docs | ||||||||||||||||||||||||||
| default | boolean | false | Whether the preview card is initially open. To render a controlled preview card, use the open prop instead. | |||||||||||||||||||||||
| open | boolean | — | Whether the preview card is currently open. | |||||||||||||||||||||||
| on | — | Event handler called when the preview card is opened or closed. | ||||||||||||||||||||||||
| ||||||||||||||||||||||||||
LinkPreviewHoverTrigger
<a>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UIPreviewCard.TriggerBase UI docs | |||||||||||||||||||||
| handle | PreviewCardHandle<unknown> | — | A handle to associate the trigger with a preview card. | ||||||||||||||||||
| payload | unknown | — | A payload to pass to the preview card when it is opened. | ||||||||||||||||||
| delay | number | 500 | How long to wait before the preview card opens. Specified in milliseconds. | ||||||||||||||||||
| |||||||||||||||||||||
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. | ||||||||||||||||||
LinkPreviewHoverContent
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | — | Show an arrow that points at the link. The gap grows from 4px to 8px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | — | Put a clear layer under the card (Base UI PreviewCard.Backdrop). Hover on the page stops. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<PreviewCardBackdropProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<PreviewCardArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIPreviewCard.PortalBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anchor | — | An element to position the popup against. By default, the popup will be positioned against the trigger. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position | "absolute""fixed" | 'absolute' | Determines which CSS position property to use. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| side | "bottom""inline-end""inline-start""left""right""top" | 'bottom' | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Built with
Installs with Link Preview
- Components
- Button,Hover Card,Image,Skeleton





