Skip to content

Cart

The whole cart is one POST form, so quantities, the discount code and the checkout button (name="checkout") reach the platform’s own cart endpoint. Totals are worked out from the items.

Your cart

4 items

91%

£68

Continue shopping
  • items: list of LineItem props (id, title, href, image, variant, price, compareAt, quantity)
  • title: page heading (default “Your cart”)
  • delivery: delivery cost (default 4.95)
  • freeDeliveryFrom: shows a progress bar and message towards free delivery; delivery becomes free once the subtotal reaches it
  • discount: shows the discount code field (default true)
  • currency, checkoutLabel, continueHref
  • action: form action (default /cart)
  • layout: split (default, summary beside the items), stacked (summary below)
  • upsell: ProductRail props for a rail beneath the cart
  • id: prefix for field ids (default cart)

An empty items list shows a short message and a continue shopping button.

<Cart
items={items}
freeDeliveryFrom={300}
upsell={{ title: "You may also like", products: related, perView: "4" }}
/>
layout="stacked" with upsell

Your cart

3 items

100%
Continue shopping

You may also like

A cart drawer is a composition of the Drawer, compact LineItems and a footer with the subtotal and checkout. Any element with data-dialog-open="<id>" opens it.

Cart drawer

Your cart (4)

91%
<Button icon="shopping-bag" data-dialog-open="cart-drawer">Cart (3)</Button>
<Drawer id="cart-drawer" title="Your cart (3)">
<ProgressBar value={240} max={300} label="Spend £60 more for free delivery" />
{items.map((item) => <LineItem {...item} density="compact" />)}
<div slot="footer">
<Price amount={240} prefix="Subtotal" />
<Button href="/checkout/">Checkout</Button>
<Button href="/cart/" variant="quiet">View cart</Button>
</div>
</Drawer>