Source Card

Citation source card for AI answers showing a title, a source badge, the truncated URL and a short snippet. List references under a generated response.

src/registry/ui/source-card.tsx/r/source-card.json

Installation#

bash
npx shadcn@latest add @minidev/source-card

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/source-card.json

Usage#

tsx
import { SourceCard } from "@/components/ui/source-card"

export function Example() {
  return (
    <SourceCard
      className="max-w-sm"
      title="Radix Select"
      url="https://www.radix-ui.com"
      snippet="Accessible select primitive."
    />
  )
}

API reference#

SourceCard props
PropTypeDefault
titlestring"DESIGN.md"
urlstring"local://DESIGN.md"
snippetstring"Hairline · Geist Sans · accent hue 2...
classNamestring-

Dependencies#

npm

React only

Built from

Examples#

All AI chat UI components for React