Grounding meterPro
How much of an answer its sources back, sentence by sentence.
On this page
ProFive sentences: three backed, one partly, one with no source.
Installation
Usage
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
| Prop | Type | Notes |
|---|---|---|
sentences | { text, support, sources? }[] | support: supported, partial or unsupported |
onSelect | (index) => void | Scroll the answer to a sentence |
labels | Partial<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.