Citation Card
ProNewInline numbered citations in AI answers that reveal floating spring-animated source preview cards on hover or focus.
Installation
pnpm dlx shadcn@latest add @viewport/citation-card
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
<Citation>
| Prop | Type | Default |
|---|---|---|
| source* | CitationSourceSource metadata shown inside the floating preview card. | — |
| className | string | — |
<CitationList>
| Prop | Type | Default |
|---|---|---|
| sources* | CitationSource[]Compact strip of source pills rendered below an AI response. | — |
| className | string | — |
Accessibility
- Each citation is a real external link with an accessible name including its source number and title.
- Preview cards open on keyboard focus as well as pointer hover.
- Tooltip pop-in disables spring scaling under reduced motion.