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
| Prop | Type | Default | Description |
|---|---|---|---|
register | ReturnType<typeof useRegisterSession> | required | Register session status, overdue and enabled state, closing state, and last closure |
registerId | string | null | required | Bound register ID, or null when no register is chosen |
online | boolean | required | Whether the store and app can be reached; false is shown as offline |
awaitingStore | number | 0 | Sales 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" |
registerName | string | --- | Name shown when multiRegister is true and a register is bound |
multiRegister | boolean | required | Whether the store has multiple registers and needs the register name displayed |
onOpenPanel | () => void | required | Called when the Register panel button is pressed |
onPressPill | () => void | --- | Makes the status pill a button and handles its press |
storeName | string | --- | 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 |
syncStatus | ReactNode | --- | 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 |
className | string | --- | Override status bar container styles |