GodUI

Source Citations

Inline numbered citation pills that spring out a rich preview card on hover, plus a collapsible source list for AI answers.

Modern design systems standardize on OKLCH for perceptually uniform theming1, and Tailwind v4 ships a CSS-first config that makes tokens first-class2. Motion is now treated as a core craft, not a finishing touch3.

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/source-citations.json"

SourceCitation renders a compact numbered pill inline with text; on hover or focus it springs out a preview card with the hostname, title, and snippet. SourceList renders the full source set as a footer, optionally collapsed behind a +N more toggle.

Usage

tsx
 
import {
  SourceCitation,
  SourceList,
} from "@/components/godui/source-citations";
tsx
 
<p>
  Answer text<SourceCitation index={1} source={source} />.
</p>
<SourceList sources={sources} previewCount={3} />

Props

SourceCitation

PropTypeDefaultDescription
indexnumberNumber rendered in the pill.
sourceCitationSourceTitle, url, snippet, favicon.

SourceList

PropTypeDefaultDescription
sourcesCitationSource[]Sources to list.
collapsiblebooleantrueCollapse extras behind a toggle.
previewCountnumber3Shown before +N more.

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub