This component no longer exists. It was in ns-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-07 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Citation Grounding Hatch
ns-ui/citation-grounding-hatchRemovedComponent
A per-sentence grounding trace under an AI answer: solid where a source backs the claim, a bare hairline where the model is inferring alone, diagonal hatch where a source contradicts it — shape-encoded, never color, with a static legend keying each mark to its meaning and a click-to-raise source panel.
Live preview
live · rendered by the registry
Rendered by ns-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://design.helpmarq.com/r/citation-grounding-hatch.jsonSource
1"use client";23import { useEffect, useMemo, useRef, useState } from "react";45// BedrockTrace — a grounding instrument strip for a RAG answer. Citation6// pills answer "what backs this claim"; this answers "how much of the WHOLE7// answer is actually supported", including the dangerous unsupported middle8// citation pills silently skip. One 3px core-sample track runs under the9// prose, cut into one segment per sentence: a thick solid bar where a source10// grounds the claim, a bare hairline where the model is inferring on its own11// (the gap is drawn, not omitted), and a diagonal hatch where a source12// actively contradicts the claim. Grounded/contradicted/unsupported is13// shape-and-pattern encoded — solid / absent / hatched — never color, so it14// survives grayscale and color-blindness. A static text legend ("Grounded /15// Unsupported / Contradicted", each next to its own always-rendered swatch)16// sits above the track so the encoding reads at rest, before anyone hovers,17// focuses, or clicks a segment — the marks alone were review feedback18// (twice) as illegible without that key.19//20// Every segment is a real <button>, labeled "Sentence N: supported by21// Source B" / "no source" / "contradicted by Source C". Hovering OR22// focusing a segment brightens its sentence in the prose above (and vice23// versa) via a shared `data-sentence-id`, so keyboard users get the same24// linkage sighted mouse users do. Clicking a grounded or contradicted25// segment raises a glass detail panel with that source's excerpt, the26// matching span underlined in accent — and the same accent underline lands27// on the sentence itself, so the claim and its evidence light up together.28// The panel expands via a CSS grid-template-rows 0fr->1fr trick (no29// JS height measurement, no clipping-by-ancestor hazard).30//31// Segments reveal left-to-right via SVG stroke-dashoffset (pathLength=1, so32// no pixel-length measurement is needed) starting ~300ms after a sentence33// first appears in the `sentences` array — the trace visibly catches up to34// prose that is still streaming in. A summary line ("4 of 6 sentences35// grounded, 1 contradiction") is aria-live=polite and IS the sighted36// digest, not a hidden echo of it. Zero dependencies; no canvas; every37// color is a token (--background --foreground --muted --border --accent),38// --accent appearing only on focus rings and the two interactive39// highlights above. prefers-reduced-motion drops all transitions — the40// … truncated
