An answer that shows where it came from: what was searched, the sources it read as numbered cards, and the answer with numbered markers. Point at a marker and its source lights up; choose a source and every claim that leans on it is marked.
Installs components/ui/sourced-answer.tsxDepends on lucide-reactMotion none in component source
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
Sources before the answer
The sources appear as soon as they are found and before a word of the answer, so people can see what it is built on while it is still being written.
Markers and sources point at each other
A marker lights its source card and scrolls it into view; a chosen source marks every claim that cites it. Checking an answer should never mean counting brackets.
Never show half a marker
While the answer streams, an unfinished “[1” is held back until it closes, so the text never flashes raw brackets.
Styling
Numbers, not favicons, carry identity
Each source is a number and its site in monospace; no third-party icons are loaded, so the card looks the same offline and in any theme.
Usage
Pass plain text with markers
Write the answer with [1] or [2, 3] where a claim is supported, and pass shown while streaming; parsing and linking are done for you.
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
It exposes status semantics, with aria-busy, aria-hidden, aria-label, aria-pressed, aria-describedby and aria-live kept in step with state. Changes that matter are announced through a live region.
No custom key handling; Tab and the native activation keys do the work.
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.