Search

Search components and blocks

Sign in

Citations

Inline citations for AI-written text. The cited phrase gets a subtle highlight and a pill after it with stacked, green, amber and red source logos, the first source's domain and how many more back it ('example.com +5'). Hover the pill and a card springs open beneath it: arrows and a 1/N counter, a progress line in the current source's color, then its logo, title, domain, description, a kind badge and a Visit source link. Paging slides the content in the direction you move.

pnpm dlx shadcn@latest add @ditherui/citations

According to recent studies, artificial intelligence has shown remarkable progress in natural language processing. The technology continues to evolve rapidly, with new breakthroughs being announced regularly .

Install

$ pnpm dlx shadcn@latest add @ditherui/citations

Props

segments{ text: string; sources?: { title: string; url: string; description: string; kind?: string }[] }[]sample text
classNamestring—

Citations Numbered

Pro

A second variety of Citations, footnote style. The cited phrase gets a dotted underline and a small numbered chip after it. Hovering the chip fills it, darkens the underline and springs open the same paging sources card. Notes number themselves in reading order. Needs the Citations component, which supplies the card.

pnpm dlx shadcn@latest add @ditherui/citations-numbered

Sleep plays a central role in memory, because the brain replays and strengthens new connections overnight. Even a short nap can help, and skipping sleep after learning erases much of the gain.

Props

segments{ text: string; sources?: { title: string; url: string; description: string; kind?: string }[] }[]sample text
classNamestring—

When to use the citations

Use citations to attribute AI-written text. The cited phrase is highlighted and a pill shows stacked source logos and the first source's domain.

  • Open the CLI tab on any preview above for the exact shadcn command. The source is copied into your project, so you can edit it like any other file.

Suggested components