Jack UI logoJackUI
Blocks

Printer

A tactile physical result-reveal block for SaaS apps. Turns boring async spinners and checkout delays into an authentic thermal receipt printer animation with realistic audio and paper ejection.

Live Preview
Interactive SaaS Block

Physical Result Reveal Engine

Transform boring async spinners and checkout delays into a tactile mechanical receipt printing experience.

THERMAL•POS

💡 Stepped line-by-line thermal feeding and chassis micro-vibration animate until async actions settle.


Installation

Pro Component

PRO

Direct CLI installation and source code access are available with Jack UI Pro.


Usage

1. Interactive Showcase Block

Render the full turnkey experience with preset template switcher tabs (Checkout, Invoice, Event Pass, API Key, Recap, Diploma, Coupon, Jam Demo):

import { Printer } from "@/components/jackui/blocks/printer/printer";

export default function Page() {
  return (
    <Printer 
      title="Order Confirmation"
      subtitle="Your transaction has been processed successfully."
      initialTemplate="checkout"
    />
  );
}

2. Individual Machine with Custom Card

Wrap any custom component inside PrinterMachine to trigger an authentic thermal printing animation while executing an async action (like charging a credit card or generating an API key):

import { 
  PrinterMachine, 
  Receipt 
} from "@/components/jackui/blocks/printer/printer";

export default function CheckoutPage() {
  const handlePayment = async () => {
    // Executes your async payment or server action:
    await processCheckoutPayment();
  };

  return (
    <PrinterMachine
      buttonLabel="Print"
      onPrint={handlePayment}
      minDuration={2400}
      size="md"
      soundEnabled={true}
    >
      <Receipt 
        storeName="SaaS Store"
        orderNumber="#ORD-8821"
        total={49.00}
      />
    </PrinterMachine>
  );
}

Real-World Use Cases

The Printer Block replaces standard loading spinners with a tactile, memorable physical moment:

  • E-Commerce & SaaS Checkout: When a Stripe/PayPal payment resolves, dispense an itemized receipt with order details and a jagged torn paper boundary.
  • Developer Tooling & API Key Minting: Display generated API keys and secrets with masked reveal toggles and instant 1-click clipboard copy.
  • Event Passes & Conferences: Issue attendee passes with dynamic attendee names, event titles, and scannable SVG QR codes.
  • Milestones & Year-In-Review: Viral achievements and annual metric summaries (Spotify Wrapped / Receiptify style) designed for screenshot sharing.
  • Vouchers & Promotional Discounts: Reward customers with a perforated dashed coupon card containing unlockable promo codes.
  • Physical POS Sync: Trigger on-screen confirmation synchronized with physical Bluetooth/USB thermal receipt printers.

Component Architecture

The block is built with a flat, modular folder structure inside components/jackui/blocks/printer/:

FilePurpose
printer.tsxMain showcase orchestrator with responsive tab navigation.
printer-machine.tsxCore tactile printer hardware unit, mechanical chassis, status LED, and roller animation.
printer-sound.tsZero-dependency Web Audio synthesizer generating realistic stepper-motor, roller feed, and paper tear sound effects.
receipt.tsxItemized retail & checkout thermal receipt with jagged torn edge.
invoice.tsxClean Net-15 professional invoice with item breakdown.
ticket.tsxEvent ticket with real-time SVG QR code and perforated tear stub.
welcome-card.tsxDeveloper onboarding badge with masked secret API key and reveal toggles.
recap.tsxMilestone & achievement card with gradient ambient glow.
certificate.tsxFormal completion diploma with double ornamental borders.
coupon-card.tsxPromotional discount voucher with dashed perforated cutout boundary.
printer-mini-preview.tsxScaled miniature preview designed for component grid showcases.

Props

Printer (Block Orchestrator)

PropTypeDescription
titlestringOptional. Block header title. Default: "Physical Result Reveal Engine".
subtitlestringOptional. Block subtitle text.
initialTemplatePrinterTemplateTypeOptional. Initial template: "checkout" | "invoice" | "ticket" | "apikey" | "recap" | "certificate" | "coupon" | "error". Default: "checkout".
showTabsbooleanOptional. Toggles the template switcher navigation tabs. Default: true.
childrenReact.ReactNodeOptional. Custom card to render inside the printer machine instead of demo tabs.
classNamestringOptional. Additional Tailwind classes for the outer wrapper section.
soundEnabledbooleanOptional. Enables Web Audio sound effects. Default: true.
soundVolumenumberOptional. Master audio volume (0 to 1). Default: 0.35.

PrinterMachine (Hardware Unit)

PropTypeDescription
childrenReact.ReactNodeRequired. The paper card content to print.
onPrint() => Promise<void> | voidOptional. Async callback executed while printing. Animation stays active until promise resolves (or minimum minDuration).
statusPrinterStatusOptional. Controlled status override: "idle" | "printing" | "done" | "error".
minDurationnumberOptional. Minimum print duration in milliseconds for tactile realism. Default: 2600.
size"sm" | "md" | "lg"Optional. Chassis size scale. Default: "md".
buttonLabelstringOptional. Label on the main chassis push button. Default: "Print".
showActionsbooleanOptional. Displays the clean receipt action toolbar (Copy and Retract) attached below the paper when printing completes. Default: true.
onCopyImage() => voidOptional. Custom clipboard copy handler. By default, copies the receipt text contents to the user's clipboard with active feedback.
onDownload() => voidOptional. Custom callback for external PDF, export, or print handling if desired by the consumer.
soundEnabledbooleanOptional. Enables Web Audio sound synthesis. Default: true.
soundVolumenumberOptional. Master audio volume (0 to 1). Default: 0.35.
refReact.Ref<PrinterRef>Optional. Imperative control ref exposing .print(), .reset(), .getStatus(), .tear(), .jam(), and .unlockSound().