A numbered citation pill linking a claim to its source
Assistant answers earn trust by showing their sources. A source chip sits inline after a sentence or in a wrapping row under the answer: a numeral, the source’s logo or a globe, then the source name, truncating before it can crowd the text around it.
Numbered citations
The citation number sits in its own small circle, tucked into the start of the pill with the same inset above, below and before it, so a run of chips reads as a numbered list at a glance.
As links
With an href the chip renders as an anchor. The pill shape is the affordance: hover deepens the background and text instead of adding an underline.
Source preview
Give a chip an excerpt and it previews its source on hover, focus or press: the full title over the passage the answer drew on, with where it lives on the line above. A logo leads that line even when the chip itself shows a number. The panel opens above the chip, drops below when there is no room, and slides sideways to stay in view. A chip with a preview and no link becomes a button, so the keyboard reaches it too.
Logos and the globe
Without a number, the leading slot shows the source’s logo, cropped to the same circle the numeral sits in. A source with no logo gets a globe, so the slot is never empty. If both an index and a logo are passed, the index wins and the logo moves to the preview.
Under an answer
The intended home: a wrapping sources row in the footer of an assistant answer, each chip linking one claim to where it came from.
Semantic tokens resolve to primitives, so overriding a single primitive cascades through every component that references it. That is what makes whole-system retheming a one-file change.
// From the npm package
import { SourceChip } from 'rift-ds/components/SourceChip/SourceChip';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/source-chip.json