Skip to content

Citation Fly

An answer whose citations travel. Pick a numbered chip and a copy flies on an arc to its source, which lands with a small pop and a flash, so you see which card it means. Back, or Escape, flies it home and puts focus on the chip again.

On this page
Used for
  • Link a claim to its source
  • Short answers with sources beside them
  • Onboarding and demos
  • Make citations obvious

Examples

Installation

npx knowns-ui@latest add citation-fly
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

textrequired
string
The answer, with [1] or [1, 3] markers numbered in the order of sources. A number with no source stays text.
sourcesrequired
FlySource[]
id, title, domain, and optionally url, quote and meta (a short line such as Updated 12 Nov).
active / defaultActive
number | null
Defaultnull
The picked source, 1-based. Controlled when active is set.
onActiveChange
(n | null) => void
A chip, Back or Escape changed the pick.
sourcesLabel
string
Default"Sources"
The heading over the cards.
Motion
-
The flight is travel across the component, 280 to 560ms by distance, ease in-out, lifting to 1.06 at most; the card lands with a 1.5% pop and the motion lib's flash. A new pick cancels a flight in the air. Reduced motion: no flight, the card is marked and focused at once.

Accessibility

  • Each chip is a toggle button named with its source and pointing at the card with aria-controls.
  • Picking moves focus to the card at once (it does not wait for the flight); Back and Escape return it to the chip that opened it.
  • The picked card is marked with aria-current and a stronger border, not by colour alone.

What it handles

  1. 01Reads [1] and [1, 3] markers out of the answer text; a number with no source stays text.
  2. 02Marks and focuses the picked source at once, then flies a copy of the chip on an arc to the source's number.
  3. 03Lands the card with a small pop and a flash, and opens its full quote with a Back button.
  4. 04Flies home on Back or Escape and returns focus to the chip that opened it.
  5. 05Lays the sources beside the answer from 44rem of width and under it below; the arc bows sideways when it travels down.
  6. 06Cancels a flight still in the air when another chip is picked, so quick clicks never queue up.

States

First render
Nothing
none
Chip picked
A copy of the chip flies to the source, faster for a short hop
560ms at most, ease in-out
Card lands
A 1.5% pop with a small overshoot, then a background flash
280ms, ease out
Back
The chip flies home and flashes
560ms at most, ease in-out
Reduced motion
No flight; the card is marked and focused at once
0ms

Works with

When to use

When to use

  • Short answers with a few sources beside them, where seeing which card a number means is the point.
  • Demos and onboarding where the link between a claim and its source should be obvious.

When not to use

  • Many citations with previews of the matched passage: use Citations.
  • An answer wired to sentences and quotes: use Grounded Answer.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Citation Fly to my app and wire it to my own data.
  • I need short answers with a few sources beside them, where seeing which card a number means is the point. Set that up with the Knowns UI Citation Fly.
  • Which Citation Fly props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "citation-fly" }) and search_docs({ query: "citation fly" }).

Need help?

Stuck on Citation Fly, or found something off? We read every message.