Sale
Brass desk lamp
Sale price£145Was£180
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.
4 items
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 itdiscount: shows the discount code field (default true)currency, checkoutLabel, continueHrefaction: form action (default /cart)layout: split (default, summary beside the items), stacked (summary below)upsell: ProductRail props for a rail beneath the cartid: 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" }}/>3 items
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.
<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>