Tally UI

ClosureList

List store Z closures by business day, alongside open tills, with settled cash figures and drawer results.

Import

import { ClosureList, type ClosureRow } from '@tallyui/components';

Usage

const rows: ClosureRow[] = closures.map((closure) => ({
  closure,
  day: closure.businessDay ?? openingDayInStoreTime(closure.openedAt, timezone),
  registerName: registerNames.get(closure.registerId),
}));
<ClosureList rows={rows} currency="NZD" timezone={timezone}
  onSelect={({ closure }) => openClosure(closure.id)} />

Stamp each row with its business day in store time. Days appear newest first and keep the host’s order within each day. Figures use settled cash: a closure with withheld figures shows dashes and suppresses its day total. On narrow screens the figures appear beneath the closure details. The tabs filter the list without changing the scope count or unmounting open sessions.

Props

PropTypeDefaultDescription
rowsreadonly ClosureRow[]requiredClosures with business days, optional display names and offline flags
currencystringrequiredCurrency of the closure’s minor units
timezonestringrequiredIANA time zone or device for day headings and row times
now() => DateCurrent timeClock for Today and Yesterday
openSessionsnumber0Number of open sessions in the slot
sessionRowsReactNode---Open session rows beneath Today
scopeFromstring---Inclusive start day; open sessions are excluded when both bounds are set and today is outside them
scopeTostring---Inclusive end day
scopeDaystring---For today alone, show “No closures today” when only open sessions exist
statusReactNode---Status content between the open sessions and closure rows
footerReactNode---Content at the bottom of the card
showEmptybooleantrueShow the empty-period message
unknownbooleanfalseHide the count when the read is unknown
filterClosureFilterLocal, initially allControlled tab: all, open or closed
onFilterChange(filter: ClosureFilter) => void---Called when a different tab is pressed
onSelect(row: ClosureRow) => void---Called when an available row is pressed

On this page