Citations

Preview

Use layout-aware motion for newly appended results 1 and preserve accessible disclosure behavior 2 as the list grows, keeping exits shorter than entrances 3.

Install

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

$ bunx --bun shadcn add @beui/citations

API Reference

Citation

citationId
string
Default—
index
number
Default—
idPrefix
string

Must match the related Citations idPrefix.

Default—
label?
string

Accessible name for the marker. Defaults to `View citation {index}`. Include the index so voice control users can say the number they see.

Default—
className?
string
Default—

CitationFavicon

url?
string
Default—
icon?
ReactNode

Drawn instead of the favicon when truthy.

Default—
className?
string
Default—

CitationStack

citations
CitationItem[]
Default—
limit?
number
Default3
className?
string
Default—

CitationList

citations
CitationItem[]
Default—
idPrefix?
string
Default—
className?
string
Default—

Citations

citations
CitationItem[]
Default—
title?
ReactNode
DefaultSources
open?
boolean
Default—
defaultOpen?
boolean
Defaultfalse
onOpenChange?
((open: boolean) => void)
Default—
idPrefix?
string
Default—
className?
string
Default—

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.

Also on React Native. Tap a number and its source springs up.

Updated