suiss/ui · AI
Inline Citation
A source link inside the sentence it supports, with a preview of the page on hover.
Inline Citation is a source that sits in the sentence it supports. The trigger is a link to the source, styled as a small Button, and a Hover Card previews its title and description.
To show a list of sources after the reply, use Sources.
Installation
Inline Citation is built with the Hover Card and Button components.
Or use the suiss/ui CLI:
Usage
AI SDK
A source-url part is the citation. Set sendSources: true on toUIMessageStreamResponse(), or write the part yourself.
title is optional. Fall back to the URL's hostname.
API Reference
See Hover Card and Button.
Accessibility
- The trigger is a real link, so the source opens with a click or Enter, and the preview opens on focus as well as on hover.
- Add "(opens in a new tab)" to the link text with
sr-only. - The hover card repeats what the link names, so readers who cannot hover lose nothing.