Tally UI

Receipt

Sale receipt with store details, line items, totals, payments, and print actions

Import

import { Receipt } from '@tallyui/components';

Usage

<Receipt
  order={order}
  posOrder={posOrder}
  store={{ name: 'Sample Store', address: '12 Market Street' }}
  cashier="Alex"
  registerId={registerId}
  registerName="Front counter"
  newSale={() => startNewSale()}
/>

Renders store and cashier details, line items, discounts, taxes, totals, payments, and change with Print receipt and New sale buttons. A finalized posOrder supplies the order reference and time; without it, the receipt shows a draft reference.

Props

PropTypeDefaultDescription
orderSentOrderrequiredSale data used to build the receipt's lines, totals, payments, and change
store{ name: string; address?: string }requiredStore name and optional address printed at the top
cashierstringrequiredCashier text printed in the receipt header
registerIdstringrequiredRegister ID passed to the receipt data builder; the ID is not printed
newSale() => voidrequiredCalled when New sale is pressed
registerNamestring---Register name printed as “Register: name”
posOrderPosOrder---Finalized order supplying the reference and creation time; omission marks the sale ID as a draft
taxLabel(ratePpm: number) => string(ratePpm: number) => `Tax ${ratePpm / 10000}%` Formats each tax row's label from its rate in parts per million
topInsetnumber0Height of the space above the receipt, hidden when printing
formatDate(iso: string) => stringdefaultFormatDateFormats the receipt time; the default uses the locale's medium date and short time
footerSlotReactNode---Printed content after the Change row and above the on-screen buttons

On this page