Skip to Content
Kokonut UI

AI-17AIUpdated, November 16, 2026

AI Inline Citations

An answer with source chips beside each claim. One preview glides between chips and lights up the sentence it backs.

Install with
lucide-react, motion

PROSlash Command Menu and more like it are in Kokonut UI Pro

Installation

AI Inline Citations is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-citations.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/ai-citations

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/ai-citations.tsx.

npm install lucide-react motion

Usage

import AICitations from "@/components/kokonutui/ai-citations";

export default function Example() {
  return <AICitations />;
}

Props

parts
AnswerPart[]Default demo data

The answer, split where citations go. Demo content when omitted.

sources
CitationSource[]Default demo data
className
string

Extra classes for the root element.

AnswerPart

textrequired
string
cite
string[]

Ids of the sources that back this text. A chip follows it.

CitationSource

idrequired
string
titlerequired
string
urlrequired
string
site
string

Short site name for the chip, such as MDN. Defaults to the host.

snippet
string

The passage that backs the claim, shown in the preview.

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.