KQ-734 · CASH/DRAWER
Cash Drawer
A till whose face plate stays put while the tray beneath it opens on snap: the tray's measured height springs from zero with one crisp overshoot, the latch popping, while the slots ride down from under the face. Count walks the denominations top to bottom on a timed tick that pauses while the tab is hidden, each slot climbing in steps so none takes longer than 600ms while its count, its subtotal and the drawer total roll on snap together; Close slides the tray back and the padlock's shackle drops on flick. Open, Count and Close are real buttons, the tray is an inert region while closed, and a status line announces open, counting, counted with the variance, and locked.
Locked
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/cash-drawer
Props
- denominations
- CashDenomination[]
- default —
- What is in the tray, largest first: value, count, and an optional kind of note or coin.
- expected
- number
- default —
- The float the drawer should hold; enables the variance line (level, over, short).
- open / defaultOpen
- boolean
- default false
- Controlled or initial drawer state.
- onOpenChange
- (open: boolean) => void
- default —
- Fires from the Open or Close press.
- onCount
- () => void
- default —
- Fires from the Count press, as the tally begins.
- onTallied
- (total: number) => void
- default —
- Fires from the tick that finishes the count, with the drawer total.
- onLock
- (total: number) => void
- default —
- Fires from the Close press with the tallied total, 0 if uncounted.
- format
- (value: number) => string
- default Intl.NumberFormat("en-US", { style: "currency", currency: "USD" })
- Formats every amount. The default pins an explicit locale so server and client agree.
- label
- string
- default "Cash drawer"
- Names the drawer for the group and the tray region.
| Prop | Type | Default | Description |
|---|---|---|---|
| denominations | CashDenomination[] | — | What is in the tray, largest first: value, count, and an optional kind of note or coin. |
| expected | number | — | The float the drawer should hold; enables the variance line (level, over, short). |
| open / defaultOpen | boolean | false | Controlled or initial drawer state. |
| onOpenChange | (open: boolean) => void | — | Fires from the Open or Close press. |
| onCount | () => void | — | Fires from the Count press, as the tally begins. |
| onTallied | (total: number) => void | — | Fires from the tick that finishes the count, with the drawer total. |
| onLock | (total: number) => void | — | Fires from the Close press with the tallied total, 0 if uncounted. |
| format | (value: number) => string | Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }) | Formats every amount. The default pins an explicit locale so server and client agree. |
| label | string | "Cash drawer" | Names the drawer for the group and the tray region. |