Sourced answer
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.
Which exchange rate do you use when a euro invoice is paid in pounds?
Searching for “exchange rate used for cross-currency invoice matching”
Searching for exchange rate used for cross-currency invoice matching
When to use
- Assistants and search that answer from documents or the web.
- Support answers drawn from a help centre, where people should check the source.
When not to use
- Answers with no sources; a plain message is honest about that.
- A list of search results people browse themselves; use search results.
Installation
pnpm dlx shadcn@latest add @caliper/sourced-answer
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.
API reference
SourcedAnswer
8 props
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
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.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/sourced-answer.mdThe index of every part is at /llms.txt.