npx shadcn@latest add https://sdk-components.thesqd.com/r/pdf-viewer.jsonreact-pdf — Renders PDF pages as canvas + text layers.import { PdfViewer } from "@/components/ui/pdf-viewer";import { PdfViewer } from "@/components/ui/pdf-viewer";
export function Example() {
return (
<PdfViewer
fileUrl="https://example.com/document.pdf"
height="auto"
/>
);
}PdfViewer (single component — built on react-pdf)
├── fileUrl="…" (any direct PDF URL)
├── height={number | string | "auto"} ("auto" sizes to the document)
└── className="…" (extends the outer container)
Built-in chrome:
• Toolbar — full-text search, zoom in / out, download
• Sidebar — clickable thumbnails for every page (click to scroll)
• Scroll surface — continuous page list, highlights search matches| Prop | Type | Default | Description |
|---|---|---|---|
fileUrl | string | — | Direct URL to the PDF file to render. |
height | number | string | "auto" | 640 | Height of the viewer surface. Numbers are treated as px. Pass "auto" to size the container to the document — the page list grows naturally and the sidebar sticks to the top as you scroll. |
className | string | — | Extends the outer container classes. |