Skip to content
Browse docs and components

Citations

citations

Sources for an AI answer: numbered inline markers that preview their source on hover or focus, and a Sources line with stacked favicons that opens into the numbered list.

Responsive

Install

$npxshadcnadd@forme/citations

Adds the component, its registry dependencies, and the token stylesheet you import once.

Examples

1 more ways to put it to work. Install one by name and it lands beside the component, or copy it from the Code tab into your app.

Answer with sources

A research answer with inline citations, a stack of favicons for how many places it drew on, and the full list beneath.

$npxshadcnadd@forme/citations-sources-list
Responsive

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

CitationFavicon

The source's own favicon, from its origin, falling back to a globe when it has none or it fails to load. Read from the site itself rather than a favicon service, so citing a page tells no third party what was cited.

PropTypeDefaultDescription
source*CitationSource—
classNamestring—

Citation

An inline marker in the text. Hovering or focusing it previews the source; choosing it opens the source. Its name includes the number, so someone using voice control can say the number they see.

PropTypeDefaultDescription
index*number—The number shown, matching the source's place in the list.
source*CitationSource—
classNamestring—

CitationStack

Up to limit favicons, overlapped: how many places an answer drew on, at a glance.

PropTypeDefaultDescription
sources*readonly CitationSource[]—
limitnumber3
classNamestring—

Citations

The sources under an answer: a Trace line — favicons, a count — that opens into the numbered list, one linked line per source. Sources arriving while it is open slide in rather than appear, so a list filling during a search reads as it happens.

PropTypeDefaultDescription
sources*readonly CitationSource[]—
titleReactNode"Sources"
defaultOpenbooleanfalse
classNamestring—