Developers
Start building
Themes/Theme SDK/Modules/cart/Defaults

Defaults

The defaults of @poltura/theme-sdk/cart.

On this page
import { … } from '@poltura/theme-sdk/cart';

CartButton

The header's cart button: the item count, and the mini cart it opens, a popover on large screens and a side sheet below.

CartButton(props: CartButtonProps): ReactElement

Props: CartButtonProps

Example

import { CartButton } from '@poltura/theme-sdk/cart';

export function HeaderActions() {
  return <CartButton icon='bag' countPlacement='overlay' showLabel={false} />;
}

See also: MiniCart, useCart

MiniCart

The mini cart's body: compact lines, the total, the minimum order, and the cart and checkout buttons, or its empty and loading states.

MiniCart(props: MiniCartProps): ReactElement

Props: MiniCartProps

Example

import { MiniCart, useCart } from '@poltura/theme-sdk/cart';

export function CartDrawerBody() {
  const { miniCart } = useCart();
  return <MiniCart surface='sheet' onClose={() => miniCart.setOpen(false)} />;
}

See also: CartButton, CartLineItem

Last updated