CitationsProv1.0.0
Where an answer's claims come from: a small numbered chip in the text opens a card with the site, title and the passage used; Sources lists them all under the answer, folding a long list after a few.
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-citationsNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
Styles didn't apply?
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Usage
Import it and pass your content. The props that matter most are listed next.
"use client";
import { Citation, Sources, type CitationSource } from "@/components/ui/lumen/controls/citations";
const sources: CitationSource[] = [
{ id: "a", title: "Quarterly report, Q3", url: "https://example.com/reports/q3", snippet: "Revenue grew 12% year on year, led by the enterprise tier." },
{ id: "b", title: "Churn dashboard notes", url: "https://example.com/notes/churn", publisher: "Internal wiki" },
];
export function GroundedAnswer() {
return (
<div className="flex flex-col gap-4 text-sm leading-6">
<p>
Revenue grew 12% year on year
<Citation index={1} source={sources[0]!} />, while churn held at 1.8%
<Citation index={2} source={sources[1]!} />.
</p>
<Sources sources={sources} />
</div>
);
}Props
Citation index / source–number / CitationSourceThe number in the text and the source: { id, title, url, snippet?, publisher?, icon? }.
Sources sources–CitationSource[]All sources, in citation order.
Sources collapseAfter4numberShow this many, then Show all (0 never folds).
Sources heading"Sources"ReactNodeThe list's heading.
labels–Partial<CitationLabels>chip(index, title), open, sources, showAll(n), showFewer.
Source
components/ui/lumen/controls/citations.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.