Ballmac UI home

Citation Coverage

New

An AI answer shown claim by claim: a coverage meter, claims with no source underlined and marked in words, numbered source markers, selecting a claim to light up its sources and quote, and a switch to see only the gaps.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed

Source coverage

3 of 5 claims have a source

source 1 source 1source 2 source 3

A wavy underline means no source backs the claim.

Sources

  1. 1Refund policyexample.com/refund

    If an item does not work as described and we cannot fix it within 14 days, we refund the full price.
  2. 2Payments FAQexample.com/payments

    Refunds go back to the original payment method.
  3. 3Team licence termsexample.com/team

Installation

$ pnpm dlx shadcn@latest add @ballmac/citation-coverage

Usage

import { CitationCoverage } from "@/components/ballmac/citation-coverage"

The full example is in the Code tab above.

Examples

Fully sourced

Source coverage

2 of 2 claims have a source

source 1 source 1source 2

Sources

  1. 1Billing guideexample.com/billing

  2. 2Tax and invoicesexample.com/tax

API reference

PropTypeDefault
claims*

The answer, split into claims in reading order.

CoverageClaim[]—
sources*

Everything the answer could cite.

CoverageSource[]—
selected

The selected claim id. Controlled.

string | null—
defaultSelected

The selected claim id for uncontrolled use.

string | nullnull
onSelectedChange

Called when a claim is selected, or null when it is cleared.

(id: string | null) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Tab, Enter / SpaceEach claim is a toggle button; selecting it shows its sources and quote
Screen readersAn unsupported claim reads '(no source)'; source markers read 'source 2'; the summary and the filtered answer are polite live regions
ColourGaps are marked by a wavy underline and words, never colour alone

Use with AI

claims is [{ id, text, sources: number[] }] in reading order (empty sources means unsupported); sources is [{ id, title, url?, quote? }]. selected / defaultSelected / onSelectedChange pick a claim. Computes the coverage percentage itself. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Citation Coverage (@ballmac/citation-coverage) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing people how much of an AI answer is grounded in sources
  • A review screen where unsupported claims need checking

Not for

  • Plain inline citations in a chat message; use citation and sources-list
  • A list of documents only; use sources-list

Registry JSON: https://ui.ballmac.com/r/citation-coverage.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.