Tally UI

CartBar

CartBar shows the sum of line quantities and the cart total in a button that opens the cart and is disabled when empty.

Import

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

Usage

import { useSale } from '@tallyui/pos';
import { CartBar } from '@tallyui/components';

// Inside a component under TaxProvider.
const sale = useSale(settings, { registerId, cashierRef });
<CartBar sale={sale} onOpen={() => setCartOpen(true)} />

Renders one button showing the sum of line quantities and the cart's total. An empty cart shows “Cart is empty” and disables the button.

Props

PropTypeDefaultDescription
saleReturnType<typeof useSale>requiredThe sale from useSale
onOpen() => voidrequiredCalled when the cart summary is pressed

On this page