Receipt

1 variant

A printed order receipt that feeds out of a printer slot, with line items, adjustments, a payment line, a barcode, and a status stamp.

Printed receipt

The paper feeds out of the slot in short jerks like a thermal printer, then a Paid, Pending, or Refunded stamp drops onto the total. Pass a new print key to print it again.

Harbor & Pine

48 Harbor Street, Portland

Oct 19, 2026 · 4:12 PM

#HP-20481


  • Studio headphones

    1 × $129.00 · Graphite

    $129.00

  • Focus desk lamp

    2 × $79.00 · Sand

    $158.00

  • Linen cable wrap

    3 × $9.00

    $27.00


Subtotal
$314.00
WELCOME10
−$31.40
Express delivery
$12.00
Tax (8%)
$22.61
Total$317.21
Paid with
Visa •••• 4242
Arrives by
Thu, Oct 22
Ship to
Ava Lindqvist, Portland 97201

HP-20481

Thank you for your order

"use client";

import { RotateCcw } from "lucide-react";
import { useState } from "react";
import { Button } from "@/components/motion/button";
import { Receipt } from "@/components/premium/receipt";

export function ReceiptPreview() {
  const [printKey, setPrintKey] = useState(0);

  return (
    <div className="flex w-full flex-col items-center gap-4">
      <Receipt printKey={printKey} />
      <Button
        type="button"
        variant="outline"
        onClick={() => setPrintKey((key) => key + 1)}
        className="h-9"
      >
        <RotateCcw className="size-4" aria-hidden="true" />
        Print again
      </Button>
    </div>
  );
}

Install

$ bunx --bun shadcn add @beui-pro/receipt

API Reference

Every prop is optional unless marked required. Data, copy, and colors default to the sample content.

Receipt16 props
  • merchant

    Merchant name, address line, and optional logo in the header.

    { name: string; detail?: string; logo?: ReactNode; }
  • orderNumber

    Order number shown in the header and encoded in the barcode.

    string

    Default HP-20481

  • issuedAt

    Display date and time, such as "Oct 19, 2026 · 4:12 PM".

    string

    Default Oct 19, 2026 · 4:12 PM

  • items

    Line items; their total becomes the subtotal. Defaults to sample items.

    readonly ReceiptItem[]
  • adjustments

    Discounts, fees, and taxes listed under the subtotal.

    readonly ReceiptAdjustment[]
  • total

    Total in minor units; defaults to the items plus adjustments.

    number
  • currency

    ISO currency code used to format every amount. Defaults to USD.

    string

    Default USD

  • payment

    Payment method shown in the "Paid with" row.

    ReceiptPayment

    Default { method: "Visa", last4: "4242" } satisfies ReceiptPayment

  • meta

    Extra label and value rows under the payment, such as delivery.

    readonly ReceiptMeta[]
  • status

    Stamp shown on the total; `null` hides it.

    ReceiptStatus | null

    Default paid

  • actions

    Buttons or links under the barcode, such as download or share.

    ReactNode
  • printKey

    Change it to print the receipt again.

    string | number
  • print

    Animate the print on mount. Turn off to show it at rest.

    boolean

    Default true

  • onPrinted

    Runs when the paper has finished feeding out.

    (() => void)
  • labels

    Overrides for the receipt's fixed text, merged over the defaults.

    Partial<ReceiptLabels>
  • className

    Classes merged onto the root element.

    string
Types5 types

The object types these props take, field by field.

ReceiptItem5 fields
  • idRequired

    Unique key for the line item.

    string
  • nameRequired

    Item name shown on the line.

    string
  • detail

    Secondary line, such as a variant or SKU.

    string
  • quantityRequired

    Number of units; multiplies the unit price for the line total.

    number
  • unitPriceRequired

    Unit price in minor currency units (cents for USD).

    number
ReceiptAdjustment3 fields
  • idRequired

    Unique key for the adjustment row.

    string
  • labelRequired

    Row label, such as a discount code or "Tax (8%)".

    string
  • amountRequired

    Amount in minor currency units; `null` shows the free label.

    number | null
ReceiptMeta2 fields
  • labelRequired

    Row label, also used as its key.

    string
  • valueRequired

    Value shown right-aligned beside the label.

    string
ReceiptPayment2 fields
  • methodRequired

    Card brand or method name, such as "Visa" or "Apple Pay".

    string
  • last4

    Last four card digits, shown after the method as "•••• 4242".

    string
ReceiptLabels6 fields
  • quantityRequired

    Formats the quantity shown before each unit price, such as "2 ×".

    (quantity: number) => string
  • subtotalRequired

    Label for the subtotal row.

    string
  • totalRequired

    Label for the total row.

    string
  • freeRequired

    Text shown for an adjustment whose amount is zero or null.

    string
  • paidWithRequired

    Label for the payment method row.

    string
  • thanksRequired

    Closing note shown under the barcode.

    string