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 Gap
ns-ui/citation-grounding-gapRemovedComponent
A single SVG baseline under a RAG answer's prose — a solid 1px plank under every sourced sentence, a fading 3-dash gap wherever a claim has none — so grounding coverage reads at a glance instead of hover-hunting citation pills.
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-gap.jsonSource
1"use client";23import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent } from "react";45// TrestleGap — grounding coverage drawn as a walkable bridge under a RAG6// answer. Citation pills (citation-inline-card) and coverage tracks (citation-grounding-hatch)7// both put the evidence signal in a SEPARATE element beside or below the8// prose; here it runs directly under the words themselves — one SVG layer,9// measured off the live sentence buttons with Range.getClientRects() (so it10// tracks real wrapped line boxes, not a straight synthetic strip), drawing a11// solid 1px plank under every grounded sentence and letting the plank12// visibly END — three fading dashes, an open gap, three dashes fading back13// in — wherever a claim has no retrieved source. The inversion is the point:14// the ABSENCE of grounding is the loudest mark on the page, not a pill that15// was simply never placed. A grounded sentence is a real <button>; Enter (or16// a click anywhere on its plank) springs up a bottom sheet with the source17// excerpt, matched words underlined in the same plank stroke (again measured18// with Range.getClientRects, this time over the excerpt's own text node, so19// resizing the sheet keeps the underlines glued to the words). An ungrounded20// sentence's gap is live: clicking it (or pressing "f" while it's focused)21// fires a targeted find-support lookup for just that claim, announced22// through an aria-live region, and on success the plank draws itself in23// left-to-right via stroke-dashoffset rather than popping solid. Sentences24// carry the accessibility semantics (aria-description: "supported by <title>"25// / "no source found"); the SVG is aria-hidden drawing underneath them, never26// the other way around. Every stroke is --border/--muted/--foreground —27// --accent is reserved for the sheet's focus ring and link, never the marks28// themselves. DOM+SVG+CSS only.2930export interface TrestleSource {31 title: string;32 excerpt: string;33 url?: string;34}3536export interface TrestleSentence {37 id: string;38 text: string;39 /** omit, or null, for a claim with no retrieval support — its plank is drawn as a gap */40 source?: TrestleSource | null;41}4243export interface TrestleGapProps {44 sentences: TrestleSentence[];45 /** Runs a retrieval attempt for one ungrounded sentence. Resolve a source on46 * success, or null/undefined if nothing was found. Defaults to a small47// … truncated
