Tally UI

CartBar

Cart summary button showing the item count and total

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