Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Context Cards

ProNew

Retrieved RAG knowledge chunk cards with source badges, relevance meters, type filters, and expandable excerpts.

Installation

pnpm dlx shadcn@latest add @viewport/context-cards

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
chunks*ContextChunk[]

Retrieved chunks to display.

—
totalChunksnumber

Total indexed chunks shown in the header pill.

—
labelstring

Optional heading label.

"Retrieved context"
classNamestring—

Accessibility

  • Filter pills expose aria-pressed; chunk rows are disclosure buttons with aria-expanded.
  • Relevance percentages remain readable as text alongside the visual meter.
  • Filter reflow and panel expansion respect prefers-reduced-motion.