Tally UI

CartPanel

Scrollable cart panel with header, line items, and footer slots

Import

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

Usage

<CartPanel
  items={cartItems}
  renderItem={(item) => <CartLine item={item} />}
  header={<CustomerCard doc={customer} />}
  footer={<CartTotal items={cartItems} />}
/>

A scrollable cart panel that composes line items into a list with optional header and footer slots. The header typically holds customer info, and the footer holds totals or a checkout button.

Props

PropTypeDefaultDescription
itemsCartLineItem[]requiredCart line items to render
renderItem(item, index) => ReactNoderequiredRender function for each line
headerReactNodeHeader slot (e.g. customer info)
footerReactNodeFooter slot (e.g. totals, checkout button)
emptyStateReactNodeContent shown when items is empty
classNamestringOverride container styles

CartLineItem

interface CartLineItem {
  doc: any;       // RxDB product document
  quantity: number;
}

Live demo

On this page