Open this example in the interactive library
Live preview
Source code
// components/PrintableContentSheet.tsx
import type { ReactNode } from "react";
export default function PrintableContentSheet({
heading = "Workshop",
children = "Details are available at the front desk.",
}: { heading?: string; children?: ReactNode } = {}) {
return (
<article>
<h1>{heading}</h1>
{children}
<button onClick={() => window.print()}>Print sheet</button>
</article>
);
}
