InlineCitation
Numbered references inside a sentence, each with a hover preview of its source.
Install it:
npx shadcn add @ambientui/inline-citationLive
Two claims, two sources
Optimistic updates keep the composer responsive while the server confirms the write. The store already exposes a consistent snapshot for every subscriber, so no extra reconciliation pass is needed.
Behavior
- ·Reference chips say the reply used these sources; a citation says THIS sentence rests on THIS one — the difference between provenance and a bibliography.
- ·The preview opens above the line, because a card below would cover the text still being read.
- ·It responds to focus as well as hover, so the preview is reachable by keyboard.
- ·The marker inverts while open — the only state it has, and enough to tell you which one you are reading.
When to use
- ·Answers where individual claims have individual sources.
- ·Anywhere a reader may want to verify one sentence without auditing the whole reply.
When not to
- ·On every sentence; a paragraph of superscripts is unreadable and reads as defensiveness.
- ·When the source does not actually support that specific claim — a citation is a promise.