Skip to content

CitationMarker

Stable

A small numbered link that points to a source, placed after a claim in a reply.

Also known as inline citation, footnote, reference marker, citation

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

In a sentence

Revenue grew 12% year on year1, driven by subscriptions2.

Markers sit right after the text they support.

When to use it

A small raised number after a claim that links to its source, like a footnote. It keeps the sentence readable while letting people check where a fact came from.

Use it for

  • After a claim in a reply that comes from a source.
  • Linking to a matching entry in a source list on the same page.

Not for

  • Showing a source's details when people point at it: use CitationHoverCard.
  • The full list of sources under a reply: use SourceList.
  • A label that stands outside a sentence: use Badge.

Do and avoid

Bags are free up to 20 kg1 on this fare.

Do. A small number right after the claim points to its source.

Bags are free up to 20 kg on this fare. (Sources at the end, somewhere.)

Avoid. A claim with no marker cannot be traced to anything.

Do

  • Number markers in the order the sources first appear.
  • Give each a title, so the tooltip and screen readers say what the source is.
  • Give each marker a real link, or give your source list matching anchors.
  • Place the marker right after the claim.

Avoid

  • Do not use it for footnotes that are not links.
  • Do not reuse a number for different sources in one message.
  • Do not use it outside a sentence. Use Badge for a standalone label.
  • Do not rely on hover to show the source. People on touch screens never see it.

On a phone

  • The marker is only 16px tall, but on touch screens it gets an invisible tap area about 8px larger on each side.
  • Its number is 12px on touch screens.
  • The tooltip with the source title needs a hover, so a phone only sees the number. Show the source name in the list below the text.

Build your next AI screen with Tattva.

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

Get started