AI Citation Check

AI Citation Check is a copy-paste React component that stops unverified references slip into ai text before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/ai-citation-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 2 extra npm packages
  • A11y guidance in docs

StopsUnverified references slip into AI text

Was this component page useful?

How do I install AI Citation Check?

pnpm dlx shadcn@latest add @bollard/ai-citation-check

The files land in your project. They're yours to edit.

How do I use AI Citation Check in React?

ai-citation-check-usage.tsx
import { AiCitationCheck, type Reference, type VerifyResult } from "@/components/ui/ai-citation-check"

<AiCitationCheck
  id="citation-demo"
  value={text}
  onValueChange={(v) => {
    setText(v)
    setDone(false)
  }}
  year={2026}
  sourceName="Crossref or CourtListener"
  verify={async (ref: Reference) => {
    await new Promise((r) => setTimeout(r, 500 + (ref.start % 5) * 150))
    return KNOWN[ref.key ?? ""] ?? false
  }}
  onSubmit={async () => {
    await new Promise((r) => setTimeout(r, 400))
    setDone(true)
  }}
/>

What input mistakes does AI Citation Check catch?

  • DOI prefixes that do not belong to the publisher of the journal named
  • Long dashes inside a DOI and leftover AI citation markers, with one-tap fixes
  • Case reporter/year combinations that cannot exist, and years in the future
  • Long quotes with no attribution
  • References your verify function could not confirm, shown as Unverified rather than fine

What props does AI Citation Check accept?

AiCitationCheck props
PropTypeDefault
value

Controlled text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
verify

Looks a reference up (Crossref for DOIs, CourtListener for cases, a HEAD request for links). Rejections show as Unverified.

(ref: Reference, signal: AbortSignal) => Promise<VerifyResult>—
sourceName

Named in "No record of this in …".

string"the lookup"
year

The current year, for "hasn't happened yet". Defaults to the device's year.

number—
onSubmit

Called on submit. May return a Promise. Anything made up or unverified needs a second press.

(value: string) => void | Promise<void>—
maxVisible

References listed before "Show N more". Default 5.

number5
className

Class for the outer wrapper.

string—
textareaClassName

Class for the textarea.

string—
messages

Override any visible string.

Partial<Omit<Messages, "status" | "kind">> & { status?: Partial<Messages["status"]>; kind?: Partial<Messages["kind"]> }—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is AI Citation Check accessible?

  • Textarea gets aria-invalid and aria-describedby pointing at the summary
  • Lookup progress is announced in a role="status" region; the submit confirmation uses role="alert"
  • "Show" moves focus to the reference in the list
  • Statuses use text and icons, not colour alone; motion respects prefers-reduced-motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Without a verify function it only checks the text for tells; it cannot confirm anything exists
  • A reference that exists may still be misquoted or not support the claim
  • Publisher-prefix and reporter heuristics cover common cases, not every journal or court
  • Submitting is still possible after a second press

What expensive mistakes does AI Citation Check stop?

Unverified references slip into AI text

Also known as

citations · references · bibliography · doi · crossref · courtlistener · legal brief · hallucination

Field type

What dependencies does AI Citation Check require?

AI Citation Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameAI Citation Check
Registry identifier@bollard/ai-citation-check
Install commandnpx shadcn@latest add @bollard/ai-citation-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about AI Citation Check

What form validation mistake does AI Citation Check catch?

AI Citation Check prevents unverified references slip into AI text. Flags references in AI-written text that look made up and looks each one up, so fake cases and DOIs are caught before they go out. Catches: DOI prefixes that do not belong to the publisher of the journal named, Long dashes inside a DOI and leftover AI citation markers, with one-tap fixes, Case reporter/year combinations that cannot exist, and years in the future, Long quotes with no attribution, References your verify function could not confirm, shown as Unverified rather than fine. Limitation: validate ai-citation-check schemas on backend.

How do I install ai-citation-check with shadcn?

Run `npx shadcn@latest add @bollard/ai-citation-check`. Sources added: registry/default/ai-citation-check/ai-citation-check.tsx, registry/default/ai-citation-check/citations.ts. Package requirements: lucide-react, motion.

What props customize AI Citation Check?

AI Citation Check accepts `value`, `defaultValue`, `onValueChange`, `verify`, `sourceName`. Configures citations, references, bibliography behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of ai-citation-check?

Without a verify function it only checks the text for tells; it cannot confirm anything exists. A reference that exists may still be misquoted or not support the claim. Publisher-prefix and reporter heuristics cover common cases, not every journal or court. Submitting is still possible after a second press Server requirement: backend verification for ai-citation-check.

How does AI Citation Check meet accessibility guidelines?

Textarea gets aria-invalid and aria-describedby pointing at the summary. Lookup progress is announced in a role="status" region; the submit confirmation uses role="alert". "Show" moves focus to the reference in the list. Statuses use text and icons, not colour alone; motion respects prefers-reduced-motion. Minimizes errors: chatgpt made up citations, hallucinated references.

Which components pair with AI Citation Check?