Display

LinkCard

Rich link preview with Open Graph metadata, favicon, domain, and optional AI reasoning. Turns a bare URL into a visual, trustworthy reference.

Installation

Terminal
npx taw-ui add link-card

This copies the component source and schema into your project. You own the code — customize anything.

Usage

server — define tool
import { tool } from "ai"
import { LinkCardSchema } from "@/components/taw/link-card"

export const showLink = tool({
  description: "Show a rich link preview",
  parameters: z.object({ url: z.string().url() }),
  outputSchema: LinkCardSchema,
  execute: async ({ url }) => {
    const og = await fetchOpenGraph(url)
    return {
      id: slugify(url),
      url,
      title: og.title,
      description: og.description,
      image: og.image,
      domain: new URL(url).hostname,
      favicon: og.favicon,
      reason: "Relevant to your question",
      confidence: 0.94,
      source: { label: "Web Search" },
    }
  },
})
client — render
import { LinkCard } from "@/components/taw/link-card"
import type { TawToolPart } from "taw-ui"

function ToolOutput({ part }: { part: TawToolPart }) {
  // Handles loading, error, and success states
  return <LinkCard part={part} />
}

Props

FieldTypeDescription
part*TawToolPartTool call lifecycle state — handles loading, error, and success
animatebooleanEnable entrance animations and image hover (default: true)
classNamestringAdditional CSS classes on the wrapper

Schema

LinkCardSchema
FieldTypeDescription
id*stringStable identifier
url*stringTarget URL
title*stringPage title
descriptionstringMeta description or excerpt
imagestringOpen Graph image URL
faviconstringSite favicon URL
domainstringDisplay domain (auto-extracted if omitted)
reasonstringWhy the AI is sharing this link
publishedAtstringPublication date
confidencenumber (0-1)AI confidence this link is relevant
caveatstringUncertainty note
sourceSourceData provenance (label + freshness)

Features

OG metadata

Title, description, and image from Open Graph tags

Favicon + domain

Visual trust signal with site identity

AI reasoning

Optional callout explaining why this link matters

Confidence scoring

Visual indicator of link relevance

Auto domain extraction

Parses domain from URL if not provided

Hover interaction

Border glow + image scale on hover

Related