Low confidencePro
Marks the parts of an answer the model is unsure about, calmly, with the reason on hover or focus and a line that steps through them.
On this page
Installation
Usage
import { LowConfidence, Unsure, UnsureSummary } from "@/components/ui/chatcn/pro/low-confidence"
<LowConfidence>
<MessageContent>
The earliest you can leave is{" "}
<Unsure reason="The move in date on page 1 differs from the signing date.">31 August</Unsure>.
</MessageContent>
<UnsureSummary />
</LowConfidence>An uncertain part gets a soft dotted underline in a quiet gray, no color and no icon in the text: it asks for a second look without raising the alarm. Hover or focus opens a small card with the reason in a sentence and an optional way to check. UnsureSummary counts the marked parts (2 parts may need checking); pointing at it lights them all at once, and Review steps the focus through them in reading order, which opens each reason in turn. marked={false} turns the markings off for readers who prefer plain text.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
LowConfidence.marked | boolean | Show the markings. Default true |
Unsure.reason | ReactNode | Why: what conflicts or what could not be checked |
Unsure.title | ReactNode | Default Not sure about this |
Unsure.action | ReactNode | A link or button to check, under the reason |
UnsureSummary.labels | { count?, review?, next? } | For translation |
Keyboard
| Key | Action |
|---|---|
| Tab | Reach each marked part; its reason opens on focus |
| Escape | Close the reason |
Accessibility
- Each marked part is focusable and described by its reason, so screen readers hear it on focus rather than inline.
- Forced colors turn the dotted underline solid so the marking survives.
Motion
The reason card grows from the text in 150 ms and closes in 100 ms; from the keyboard it opens without animation. Underline and highlight changes are color only.