Tally UI

RegisterBar

RegisterBar shows the store or register name, the cashier, the sync and status state, a Register button, and the menu on phones.

Import

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

Usage

<RegisterBar
  register={register}
  registerId={registerId}
  online={online}
  registerName="Front counter"
  multiRegister={true}
  onOpenPanel={() => setRegisterOpen(true)}
/>

Renders the place (the store, and the register for stores with more than one), a status pill when applicable (a warning dot and its word, as WCPOS v2), the app's sync state, a Register button when a session or last closure exists, and the cashier. Supplying onPressPill makes the pill a button. Inside a phone AppShell the bar starts with a menu button that opens the drawer.

Props

PropTypeDefaultDescription
registerReturnType<typeof useRegisterSession>requiredRegister session status, overdue and enabled state, closing state, and last closure
registerIdstring | nullrequiredBound register ID, or null when no register is chosen
onlinebooleanrequiredWhether the store and app can be reached; false is shown as offline
awaitingStorenumber0Sales the store has still to hear: offline the pill reads "Offline · N sales to send"; online, when no other pill shows, "N sales awaiting store"
registerNamestring---Name shown when multiRegister is true and a register is bound
multiRegisterbooleanrequiredWhether the store has multiple registers and needs the register name displayed
onOpenPanel() => voidrequiredCalled when the Register panel button is pressed
onPressPill() => void---Makes the status pill a button and handles its press
storeNamestring---Store name; with multiRegister and a bound register the bar reads "Store · Register"
cashier{ name: string; onPress?: () => void }---Signed-in cashier, shown as an initials avatar; pressable when onPress is given
syncStatusReactNode---The app's sync state, drawn before the Register button
onOpenMenu() => void---Shows a menu button first in the bar; inside a phone AppShell the shell supplies it
classNamestring---Override status bar container styles

On this page