CortexcnCortexcn
Pro

Usage Receipt

A thermal receipt that feeds out of a printer slot, printing each line of usage left to right with dotted leaders, then the subtotal, tax, a total that counts up, and a barcode, before it is torn off and printed again.

Lumen API, Usage receipt, Nov 14, 2026, 2:02 PM, INV-20461. Chat tokens: $96.14. Embeddings: $4.20. Image renders: $12.48. Voice minutes: $5.16. Storage: $0.92. Tax: $9.51. Total: $128.41.

Installation

ProPart of Cortexcn Pro

The source for usage-receipt comes with a Cortexcn Pro license, along with every other chart and the website templates. Pick a license on the pricing page.

Already have a license? Open the code

Usage

import { UsageReceipt } from "@/components/usage-receipt";
<UsageReceipt
  merchant="Lumen API"
  issued="Nov 14, 2026, 2:02 PM"
  reference="INV-20461"
  items={[
    { label: "Chat tokens", detail: "184,200 in, 41,900 out", amount: 96.14 },
    { label: "Embeddings", detail: "2.1M tokens", amount: 4.2 },
    { label: "Image renders", detail: "312 at 1024px", amount: 12.48 },
  ]}
/>

The receipt adds up items, applies taxRate, and draws the barcode from reference. Use it on a pricing page to show what a month of usage costs, or in a billing screen as the last step of checkout.

Examples

Monthly hosting

A hosting bill with no tax line.

Fieldnote Cloud, Monthly usage, Nov 1, 2026, 9:00 AM, FN-88213. Bandwidth: $54.00. Build minutes: $21.40. Edge requests: $19.10. Seats: $80.00. Total: $174.50.

Static

With animated={false}, the whole receipt shows at once.

Lumen API, Usage receipt, Nov 14, 2026, 2:02 PM, INV-20461. Chat tokens: $96.14. Embeddings: $4.20. Image renders: $12.48. Voice minutes: $5.16. Storage: $0.92. Tax: $9.51. Total: $128.41.

Behavior

  • When the receipt comes on screen, the paper feeds out of the slot one line at a time, every interval seconds, and each line prints from left to right. The light on the printer glows while it prints.
  • After the last line, the totals feed out, the total counts up, and the barcode prints. With loop, the receipt hangs for a moment, tears off, and a fresh one prints.
  • With reduced motion enabled, the whole receipt shows at once and nothing moves.
  • issued is printed as given rather than formatted from a date, so the server and the browser always print the same text.
  • Screen readers hear the whole receipt at once, from a caption: every line, the tax, and the total. The printing paper is hidden from them.

Props

PropTypeDefaultDescription
itemsUsageReceiptItem[]Five sample linesThe lines the receipt prints, in order
merchantstring"Lumen API"Who the receipt is from
headingstring"Usage receipt"The line under the merchant
issuedstring"Nov 14, 2026, 2:02 PM"When it was issued, printed as given
referencestring"INV-20461"A reference; the barcode is drawn from it
taxRatenumber0.08Tax on the subtotal; 0 leaves the line out
footerstring"Thanks for building with us."A line at the foot of the receipt
currencystring"USD"An ISO 4217 code for the amounts
localestring"en-US"The locale amounts are written in
intervalnumber0.8Seconds between printed lines
animatedbooleantruePrint line by line when it comes on screen
loopbooleantrueTear it off and print it again while on screen
classNamestring-Extra classes on the frame

UsageReceiptItem

PropTypeDefaultDescription
labelstring-What was used
detailstring-How much, on a second line
amountnumber-What it costs, in currency