Skip to content
Cynco UI

Productivity

PrintButton

A "Print" button with a printer icon and a ⌘/Ctrl+P keycap; calls window.print() unless onPrint is given.

import { PrintButton } from "@cynco-labs/ui";

Example

Use

Next to any Cynco document (TaxInvoiceDocument, ReceiptDocument, ProfitAndLossReport…). Pass onPrint to route printing elsewhere (e.g. download the server-rendered PDF).

Props

onPrint?, bindShortcut? (default: true only when onPrint is set — otherwise the browser's own ⌘/Ctrl+P already prints the print layout), showShortcut (default true), children (label, default "Print"), plus Button props (variant — default secondary, size, disabled, className…).

Notes

Keyboard: Tab + Enter/Space; ⌘/Ctrl+P when bound (works from inputs too, as a mod shortcut). Hidden in print.

Source Demo source Markdown