Skip to content
pandacoderz/ui

Document Q&A

File drop, page thumbnails, and a chat whose citations jump to the cited page.

Open in new tab ↗

What’s inside

  • File Drop and File List manage indexed documents with upload progress.
  • Page thumbnails highlight the cited page and scroll to it when a citation is clicked.
  • Citation chips inside assistant messages link to pages instead of URLs.

Installation

npx shadcn@latest add https://ui.spencerwueste.com/r/document-qa.json

The registry item pulls in every component it depends on.

Usage

import DocumentQA from "@/components/blocks/document-qa/document-qa";

export default function Page() {
  return (
    <div className="h-dvh p-4">
      <DocumentQA />
    </div>
  );
}

Give the parent a bounded height. The block fills it and scrolls internally.

Going live

Index uploads into your vector store and have the model return page-numbered citations. Map each page to a Source whose url is #page-n and the click handler will jump the thumbnail column.