A React SPA that automatically prints documents when opened in Chrome kiosk mode — no print dialog, no user interaction required.
- The app renders print-ready pages using CSS
@media printfor layout and page breaks - On load,
window.print()fires automatically after a short render delay - Chrome's kiosk flags bypass the system print dialog and send directly to the default printer
- Google Chrome installed
- A default printer must be configured on the system (especially important on Windows — go to Settings → Printers & Scanners → set your printer as default)
npm install
npm run devOpens at http://localhost:5173. In dev mode, window.print() will still trigger the print dialog (kiosk flags aren't active). You'll see a status badge in the top-right corner.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--kiosk \
--kiosk-printing \
http://localhost:5173"C:\Program Files\Google\Chrome\Application\chrome.exe" ^
--kiosk ^
--kiosk-printing ^
http://localhost:5173Important (Windows): A default printer MUST be set in system settings, otherwise Chrome will still show the print dialog or fail silently.
google-chrome \
--kiosk \
--kiosk-printing \
http://localhost:5173| Flag | Purpose |
|---|---|
--kiosk |
Full-screen mode, no browser chrome (address bar, tabs, etc.) |
--kiosk-printing |
Silently prints to default printer without showing the print dialog |
npm run build
npx serve distThen launch Chrome in kiosk mode pointing to the served URL.
- Page 1 — Alignment test with a 2x2 grid
- Page 2 — Content/character rendering test
Add a new <div className="print-page"> in src/App.tsx. CSS handles the page breaks automatically — each .print-page element becomes one printed page.