Skip to content

CitationHoverCard

Stable

A small number in a sentence that shows where a fact came from.

Also known as hover card, citation preview, link preview

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Inline in a sentence

Renewables supplied about a quarter of generation last year.

Point at the number, tab to it, or tap it. Press Escape to close.

When to use it

A small number placed right after a fact that shows where it came from. The source card opens on pointing, tabbing or tapping, so checking a claim never needs a mouse.

Made of: Number · Site icon or first letter · Website · Trust label · Title · Short quote · Link to the source

Use it for

  • A fact in an AI answer that comes from a web page or document.
  • Showing a source's title, website, a short quote and a trust label without leaving the text.

Not for

  • The full list of sources for an answer: use SourceList.
  • A plain numbered link to a source, with no card: use CitationMarker.
  • A source shown as a card of its own: use SourceCard.

Do and avoid

Bags are free up to 20 kg on this fare.

Do. A small number after the fact opens its source on tap or focus.

Bags are free up to 20 kg on this fare. Extra bags cost 30 euros each way.

Airline baggage rules

example.org

Avoid. The open card covers the very sentence people are trying to read.

Do

  • Put the number right after the fact it supports.
  • Show a trust label only when you have a real reason.
  • Keep quotes short and taken straight from the source.
  • Add a Sources list too, so every source is in one place.

Avoid

  • Do not make pointing at it the only way to reach the source.
  • Do not use a trust label as a score without saying how it is decided.
  • Do not use it where the card would cover the text being read.

On a phone

  • A tap opens the card and pins it. Tap the number again or tap outside to close it.
  • The number is a small inline button. On touch screens it keeps its size and has a 44px tap area, so the line it sits in does not get taller.
  • On a phone the card is fixed along the bottom of the screen, 1rem in from each side and above the bottom safe area, so it cannot run off the edge. The Open source link is small text with no 44px target.

Seen in products

  • Perplexity shows numbered inline citations with a hover preview and trust labels such as Government, Academic and Trusted.
  • Claude responses carry verifiable citations when web search is on.
  • Google AI Overviews added hover link previews with description and image on citations.
  • Vercel AI Elements ships Inline Citation and Sources components.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started