Cash Collect
A cash-on-delivery panel - order total plus delivery fee minus prepaid, the amount received, and live short, exact or change-due feedback, with quick amounts and confirm.
Code
<CashCollect orderTotalMinor={8500} deliveryFeeMinor={1500} onConfirm={(minor) => save(minor)} />Delivery · beta
Live examples and controls: Cash Collect in the lab.
Install
npx shadcn@latest add https://docs.nasaqui.com/r/cash-collect.jsonWhat the courier must take at the door and what to hand back. Amounts are integer minor units (cents, halalas).
When to use
- Confirming cash at drop-off.
When not to use
- Card or wallet payment: use
Priceand your payment flow. - Settling a courier at day end: use
Walletor the ledger.
Import
import { CashCollect, cashBreakdown } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"Quick start
<CashCollect orderTotalMinor={8500} deliveryFeeMinor={1500} onConfirm={(minor) => save(minor)} />Anatomy
CashCollect data-slot="cash-collect" data-state
├─ breakdown: total, fee, prepaid, due
├─ CurrencyInput + quick amounts
├─ state line: short / exact / change
└─ ConfirmAPI
| Prop | Type | Default | Description |
|---|---|---|---|
orderTotalMinor | number | required | Goods total. |
deliveryFeeMinor | number | 0 | Added to the total. |
prepaidMinor | number | 0 | Already paid; subtracted. |
currency | string | "USD" ("SAR" in Arabic) | ISO currency. |
collectedMinor / defaultCollectedMinor | number | null | none | Controlled or initial received amount. |
onCollectedChange | (minor) => void | none | Input change. |
onConfirm | (minor) => void | none | Confirm tapped. |
allowShort | boolean | false | Allow confirming less than due. |
quickAmounts | number[] | derived | Quick-pick buttons, minor units. |
loading | boolean | false | Disables confirm. |
locale / labels | "en" | "ar" / partial strings | context | Language and overrides. |
cashBreakdown({ orderTotal, deliveryFee, prepaid, collected }) returns { due, collected, shortBy, change, state }
where state is unpaid, short, exact or over.
Examples
Lab stories: short, short allowed, change due, partly or fully prepaid, Arabic.
Accessibility
The state line is a polite live region. The input is labelled; confirm is disabled while short unless allowShort.
RTL & i18n
The amount field stays LTR inside RTL pages so digits do not reorder. Arabic copy is built in.
Styling & tokens
Uses --status-success, --status-warning, --status-danger. Target [data-state].
Do / Don't
- Do work in minor units end to end.
- Don't round change; show it exactly.
Related
CurrencyInput, Wallet, RouteStops.
Lab
https://docs.nasaqui.com/?path=/docs/components-delivery-cash-collect--docs
UsageMeter
A quantity used against its limit (count, money or hours) with warning and danger thresholds, an unlimited state, budget burn with a pace projection, and a plan usage panel with an overage estimate strip.
Courier Card
A courier row for dispatch screens - avatar, availability, vehicle, distance and ETA from the pickup, cash float and active orders, with a selectable list wrapper.