Skip to content
Sign in
KnowledgeGrounding meterMenu

Grounding meterPro

How much of an answer its sources back, sentence by sentence.

ProFive sentences: three backed, one partly, one with no source.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/grounding-meter

Usage

tsx
import { GroundingMeter } from "@/components/ui/chatcn/pro/grounding-meter"

<GroundingMeter sentences={sentences} onSelect={scrollToSentence} />

Segments are as wide as their sentences. Supported is solid ink, partly supported is gray and no source is hatched red, so the difference survives grayscale. The share counts partial sentences as half.

Examples

States

ProFully grounded and nothing grounded.

Props

PropTypeNotes
sentences{ text, support, sources? }[]support: supported, partial or unsupported
onSelect(index) => voidScroll the answer to a sentence
labelsPartial<GroundingMeterLabels>Every string

Accessibility

  • Each segment is a button named with its position and support; hovering or focusing reads the sentence in a polite region.