Dev Helpers
← Back

Paper size quote selector

Place this file at app/print/page.tsx in an App Router project.

Open this example in the interactive library

Source code

// app/print/page.tsx

import Link from "next/link";

export default async function PaperSizeQuoteSelector({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  const { size } = await searchParams;
  const dims = size === "A3" ? "297 × 420" : "210 × 297";
  return (
    <main>
      <Link href="?size=A3">A3</Link> · <Link href="?size=A4">A4</Link>
      <p>{dims} mm</p>
    </main>
  );
}