0
Files
app/library-browser/page.tsx
"use client";

import dynamic from "next/dynamic";

// embedpdf's plugin packages and the PDFium worker are browser-only, so the
// whole app is loaded client-side behind an `ssr: false` boundary.
const PdfLibraryBrowser = dynamic(
  () =>
    import("@/components/pdf-library-browser").then(
      (mod) => mod.PdfLibraryBrowser,
    ),
  {
    ssr: false,
    loading: () => <div className="bg-muted h-full w-full" />,
  },
);

export default function Page() {
  return (
    // The browser fills its container and scrolls inside itself, so pin an
    // explicit height here rather than letting the document grow the page.
    <div className="h-svh w-full overflow-hidden">
      {/* Three documents, so the grid opens on a shelf rather than a single
          card. */}
      <PdfLibraryBrowser
        documents={[
          { url: "/sample.pdf", name: "sample.pdf" },
          { url: "/form.pdf", name: "form.pdf" },
          { url: "/sample-with-attachments.pdf", name: "attachments.pdf" },
        ]}
      />
    </div>
  );
}

A grid of every open document beside a sidebar that inspects whichever card you pick — its preview and PDF properties, read straight from the engine. Every document renders off one engine with embedpdf's thumbnail plugin, after PDFSlick's multiple-documents example.