The cart and checkout: line items, totals, discount codes, the header badge and
add-to-cart. The package ships the data hooks and ready-made parts; your app composes
the pages.
Get started
Install the package with the peer dependencies it needs. It comes from the Evolve registry, which needs a one-time sign-in.
CartSwitcher"My carts" — a side panel whose stated job is switch carts and create carts, nothing else.
AddToCartScopeOne pending state for every add in its subtree.
CartAddedSheetThe add-to-cart confirmation: mount it once beside CartProvider and every add opens it, on a pending row until the cart answers.
CartAddBundleButtonAdds a product and the extras chosen with it in one call, as a bundle.
CartAddLinesButtonAdd several lines to the active cart in one write, creating a cart where there is none, and say why when the cart refuses.
CartAddProductButtonAdd a product to the cart, including the "no cart yet" path — useAddToCart names the current cart on the wire and lets the server create one only when there is none, so a first add is a single round trip and a second one lands in the cart the first made.
CartApprovalNoticeSays, before the buyer places a business order, that it will wait for approval: which rule, above what amount, and who decides.
CartMinimumOrderNoticeSays how much a business cart still lacks to reach the company's minimum order value, and that a quote can still be requested.
CartChangesNoticeWhat changed in the cart since the buyer last looked, at the top of the cart: sold-out lines, price changes against the price at the time of adding, lowered quantities, and lines an engine removed.
CartCrossSellUp to three products that go with what is in the cart, to place below its lines.
CartQuickAddAdd one product to the active cart by article number or name, on one line: the buyer types, picks a suggestion or keeps what they typed as the SKU, sets the quantity and adds.
QuickOrderOrder by SKU: the buyer pastes or types SKU and quantity lines, or uploads a CSV export, checks them, and sees each line resolved (name, net price, stock) or rejected with the reason.
CheckoutThe checkout: one section open at a time, the others collapsed to a summary or waiting their turn, and the summary aside.
Hooks
62 hooks to read and change the data yourself, for when you build your own UI. The example above only needs useCart. All hooks