Skip to content
Sign in
ConversationLow confidenceMenu

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.

ProA tenancy answer with two parts the model could not pin down. Hover or focus a part to read why.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/low-confidence

Usage

tsx
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

ProOne part, several, markings off, still streaming, a long reason with a way to check, and nothing uncertain.

Props

PropTypeNotes
LowConfidence.markedbooleanShow the markings. Default true
Unsure.reasonReactNodeWhy: what conflicts or what could not be checked
Unsure.titleReactNodeDefault Not sure about this
Unsure.actionReactNodeA link or button to check, under the reason
UnsureSummary.labels{ count?, review?, next? }For translation

Keyboard

KeyAction
TabReach each marked part; its reason opens on focus
EscapeClose 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.