Citations

Inline citation markers paired with a collapsible, progressively rendered reference collection for grounded agent responses.

Preview

Use layout-aware motion for newly appended results 1 and preserve accessible disclosure behavior 2 as the list grows.

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/citations

API Reference

Citation

citationId
string
index
number
idPrefix
string

Must match the related Citations idPrefix.

className?
string

CitationFavicon

url?
string
className?
string

CitationStack

citations
CitationItem[]
limit?
number
3
className?
string

CitationList

citations
CitationItem[]
idPrefix?
string
className?
string

Citations

citations
CitationItem[]
title?
ReactNode
Sources
open?
boolean
defaultOpen?
boolean
false
onOpenChange?
((open: boolean) => void)
idPrefix?
string
className?
string

Composition

Pair inline citation markers with a source disclosure owned by the same response.

StreamingResponse
├── Citation
└── Citations
    ├── CitationStack
    └── CitationList

Note: Streaming Response reveals the source summary when the answer completes. Message keeps cited answers within a semantic conversation row.

How it works

Citations connect a claim to supporting material without interrupting the answer. Inline markers should stay lightweight while the source collection provides enough information to inspect the evidence.

Updated