Skip to content

Link Preview

Free

A link shown as a card with the page title, picture, and site name, so people see where it goes. It comes as a card, a compact row, a chip, or a hover card.

  • React 19
  • Tailwind CSS 4

Added Nov 17, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap the page in LinkPreviewProvider with your adapter, then compose each LinkPreview with its parts.

shared-links.tsx

LinkPreview

<div>
PropTypeDefaultDescription
hrefRequiredstring—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.
childrenReactNode—The parts. Default: the card of the variant (LinkPreviewCard).
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

LinkPreviewCard

<a>
PropTypeDefaultDescription
...props<a> attributes—Every other attribute goes to the <a>, with a ref.

LinkPreviewContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

LinkPreviewImage

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

LinkPreviewSite

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

LinkPreviewTitle

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

LinkPreviewDescription

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

LinkPreviewMeta

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

LinkPreviewFallback

<a>
PropTypeDefaultDescription
...props<a> attributes—Every other attribute goes to the <a>, with a ref.

LinkPreviewError

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

LinkPreviewRetry

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—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.
spinnerPlacement"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
focusableWhenDisabledbooleanfalseWhether 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

PropTypeDefaultDescription
hrefRequiredstring—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.
childrenReactNode—The trigger and the card: LinkPreviewHoverTrigger and LinkPreviewHoverContent.
From Base UIPreviewCard.RootBase UI docs
defaultOpenbooleanfalseWhether the preview card is initially open. To render a controlled preview card, use the open prop instead.
openboolean—Whether the preview card is currently open.
onOpenChange—Event handler called when the preview card is opened or closed.

LinkPreviewHoverTrigger

<a>
PropTypeDefaultDescription
classNamestring—
From Base UIPreviewCard.TriggerBase UI docs
handlePreviewCardHandle<unknown>—A handle to associate the trigger with a preview card.
payloadunknown—A payload to pass to the preview card when it is opened.
delaynumber500How 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>
PropTypeDefaultDescription
classNamestring—
arrowboolean—Show an arrow that points at the link. The gap grows from 4px to 8px.
backdropboolean—Put a clear layer under the card (Base UI PreviewCard.Backdrop). Hover on the page stops.
portalProps—Other Base UI props of the inner parts. A className here adds to the component classes.
positionerProps—
backdropPropsPopupPartProps<PreviewCardBackdropProps>—
arrowPropsPopupPartProps<PreviewCardArrowProps>—
childrenReactNode—
From Base UIPreviewCard.PortalBase UI docs
anchor—An element to position the popup against. By default, the popup will be positioned against the trigger.
positionMethod"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.
  • Use it when the app has the page title and picture, from its own server or from data it keeps.
  • Use variant="compact" in a narrow list and variant="inline" inside a sentence.
  • Use LinkPreviewHover when the link must stay text and the card is extra.
  • For a preview of a person or a repository behind a link, with your own content, use a Hover Card.
  • For a file that a person attached, use an Attachment.
Press
press · 100ms · the card scales to 97%
Hover
hover · 150ms · the border and fill tint change, and the compact arrow moves up and out
Picture
panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · the picture scales to 102% on hover
Hover card
popup · 150ms · the card fades in and scales from 95% after 500ms of hover or on focus

Built with

Installs with Link Preview

  1. AddedLink Preview, with Button, Hover Card, Image, Skeleton.
Open the release