Citations for an AI answer, from inline [n] chips that preview what they quote, with the matched passage marked, to a numbered, collapsible list that scrolls to and flashes its chip. They work while the answer streams, and the final answer reads without JavaScript.
Examples
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- text
string- The answer. Blank lines make paragraphs, "- " lines a list, **bold** and `code` work, and [1] or [1, 3] cite sources (1-based). It may grow while streaming.
- sources
CitationSource[]- { id, title, kind?, url?, file?, page?, quote?, match? }. Sources that point at the same URL or file page merge, and the numbers in the text follow.
- status
"streaming"|"done"- Default
"done" - Streaming: a chip plays its short arrival as it shows up, a citation still being typed stays hidden, and the sources list stays folded until the answer is done.
- defaultOpen
boolean- Default
true - Whether the sources list starts open.
- onOpenSource
(source) => void- Enter or a click on a chip, and the card's Open action. Without it a source with a URL opens in a new tab.
- Parts
-- CitedText (the answer with chips), CitationChip, CitationCard and CitationSources can be used alone, for example inside the AI Answer item. sourceFromKnowledge and sourceFromExtract turn a Knowledge Sources row or a Document Extract page into a citable source.
- Glyphs
-- Web, file, note and code glyphs of our own, chosen by kind. No logos, so a source never looks like an endorsement.
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | - | The answer. Blank lines make paragraphs, "- " lines a list, **bold** and `code` work, and [1] or [1, 3] cite sources (1-based). It may grow while streaming. |
| sources | CitationSource[] | - | { id, title, kind?, url?, file?, page?, quote?, match? }. Sources that point at the same URL or file page merge, and the numbers in the text follow. |
| status | "streaming" | "done" | "done" | Streaming: a chip plays its short arrival as it shows up, a citation still being typed stays hidden, and the sources list stays folded until the answer is done. |
| defaultOpen | boolean | true | Whether the sources list starts open. |
| onOpenSource | (source) => void | - | Enter or a click on a chip, and the card's Open action. Without it a source with a URL opens in a new tab. |
| Parts | - | - | CitedText (the answer with chips), CitationChip, CitationCard and CitationSources can be used alone, for example inside the AI Answer item. sourceFromKnowledge and sourceFromExtract turn a Knowledge Sources row or a Document Extract page into a citable source. |
| Glyphs | - | - | Web, file, note and code glyphs of our own, chosen by kind. No logos, so a source never looks like an endorsement. |
Accessibility
- Each chip is a button named “Source 2: title”. Focusing it with the keyboard opens its card at once; Esc closes it; Enter opens the source.
- The card describes the chip (aria-describedby) and is not the only way to anything: every source is in the list, with its link.
- The sources list is an ordered list behind a disclosure button (aria-expanded); “Show source n in the answer” scrolls to the chip and flashes it, without a flash under reduced motion (the ring just stays for a moment).
- Reduced motion removes the chip arrival and the smooth scroll. Without JavaScript the finished answer shows its chips and the open list.
When to use
When to use
- [n] citation chips and a sources list, with a source preview, for an answer that cites [1], [2] in its text.
- Letting people check a claim: the card quotes the passage with the matched words marked.
When not to use
- An answer where each sentence is tied to its passage: use Grounded Answer.
- A short answer with a plain list of sources: use AI Answer.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Citations to my app and wire it to my own data.
- I need [n] citation chips and a sources list, with a source preview, for an answer that cites [1], [2] in its text. Set that up with the Knowns UI Citations.
- Which Citations props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "citations" }) and search_docs({ query: "citations" }). Pro props, full examples and source come back once your license key is in the MCP config.