Tally UI

ReceiptPreview

Renders a receipt-style summary with line items, totals, and optional payment details

Import

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

Usage

<ReceiptPreview
  items={[{ name: 'Espresso', quantity: 2, total: '$9.00' }]}
  subtotal="$9.00"
  tax="$0.72"
  total="$9.72"
/>

Displays a receipt-style card with itemised lines, subtotal, tax, and total. You can optionally show payment methods and plug in custom header or footer content through slots.

Props

PropTypeDefaultDescription
itemsReceiptItem[]requiredArray of line items
subtotalstringrequiredFormatted subtotal
taxstringrequiredFormatted tax amount
totalstringrequiredFormatted order total
paymentsArray<{ method: string; amount: string }>—Payment method rows
headerSlotReactNode—Content above the item list
footerSlotReactNode—Content below everything
classNamestring—Override container styles

ReceiptItem

interface ReceiptItem {
  name: string;
  quantity: number;
  total: string;
}

Live demo