Tally UI

Cart

Sale lines with quantity controls, discounts, charges, totals, and payment actions

Import

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

Usage

import { useSale } from '@tallyui/pos';
import { Cart } from '@tallyui/components';

// Inside a component under TaxProvider.
const sale = useSale(settings, { registerId, cashierRef });
<Cart sale={sale} />

Renders the sale's lines with quantity and removal controls, line and order discounts, totals, and cash or card terminal actions. Price editing appears when permitted, and the charge form appears when the sale's capabilities support it.

Props

PropTypeDefaultDescription
saleReturnType<typeof useSale>requiredThe sale from useSale
taxLabel(ratePpm: number) => string(ratePpm: number) => `Tax ${ratePpm / 10000}%` Formats each tax row's label from its rate in parts per million
taxClassesReadonlyArray<{ id: string; label: string }>---Tax class choices passed to the charge form
canEditPricebooleanfalseShows a Price action on each line; pass the till's price-edit permission
onPriceChange(change: { lineId: string; fromMinor: number; toMinor: number; reason?: string }) => void---Called after a price is applied for the app's audit log; the reason is kept only in this callback

On this page