Receipt Print Toast

Order confirmations that print: a thermal printer slot blinks, then a strip of receipt paper feeds out line by line in little stepped jolts with a torn zig-zag edge. After a few seconds it tears off and drops away; hover or focus holds it.

Try it: Press "Place order" to print a receipt; hover to hold it.

Installation

Install with the shadcn CLI:

npx shadcn@latest add https://www.framekitui.live/r/receipt-print-toast.json

Or, with the @framekit namespace registered: npx shadcn@latest add @framekit/receipt-print-toast. You can also copy the source into components/ui/receipt-print-toast.tsx (view on GitHub).

Usage

import { ReceiptPrintToast } from '@/components/ui/receipt-print-toast'

Props

Component props
PropTypeDefaultNotes
receiptReceipt | null—{ title, subtitle?, lines: { label, qty?, amount }[], total?, footer? } — prints whenever the object changes.
samplesReceipt[]DEFAULT_RECEIPTSOrders cycled by the built-in trigger.
triggerLabel / showTriggerstring / boolean'Place order' / trueBuilt-in trigger button.
durationnumber6000ms before it tears off (0 = until dismissed); paused on hover / focus.
onDismiss(receipt) => void—Fires when a receipt tears off or is dismissed.

Dependencies

  • motion
  • lucide-react

See all 4 Toast components