Checkout steps comes with Pro. Its preview shows once you unlock it.
Usage
import { ShopCheckout } from './ShopCheckout.jsx'
// Without onPlaceOrder the checkout runs on its sample order. Wire it to your shop:
<ShopCheckout
locale="en"
currency="USD"
freeFrom={80}
items={bag.lines} // [{ id, name, variant, price, qty, image }]
methods={[
{ id: 'standard', label: 'Standard', eta: 'In 2–4 days', price: 5 },
{ id: 'express', label: 'Express', eta: 'Tomorrow', price: 9 },
]}
customer={account.address} // { name, phone, region, street }, or null for a blank form
card={account.card} // { last4, expiry }, or null when no card is saved
loading={bag.loading}
error={bag.error}
onRetry={bag.reload}
onPlaceOrder={async (order) => (await api.placeOrder(order)).number}
onDone={() => router.push('/')}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text and sample order. |
items | Array<{ id, name, variant, price, qty, image? }> | sample bag | The lines being bought, shown in the order summary. An empty array shows the empty state. `image` is the line’s picture; without it a plain parcel is drawn. |
currency | string | by locale | ISO currency code for every amount. |
methods | Array<{ id, label, eta, price }> | standard and express | Ways of delivery. The first one is free from `freeFrom`; the others always cost their price. |
freeFrom | number | by locale | Subtotal from which the first way of delivery is free. |
customer | { name, phone, region, street } | null | sample customer | Fills the delivery step for a returning customer; null starts it blank. |
card | { last4, expiry } | null | sample card | A saved card offered first; null asks for a new card. |
loading | boolean | false | Shows the skeleton of the checkout while it loads. |
error | boolean | string | false | Shows the error banner with a retry button; a string replaces its sentence. |
onPlaceOrder | ({ items, address, method, payment, totals }) => Promise<string | void> | — | Places the order; resolve with the order number to show it. If it throws, the review step shows that the payment did not go through. |
onDone / onBrowse / onRetry | () => void | — | After the order, from an empty bag, and from the error banner. |
labels | object | — | Replaces any built-in text (keys as in copy.js), including field names and error messages. |
className | string | — | Added to the root element; other attributes go there too. |
Add it to your project
Pro includes the full source of this block. Copy its prompt to install it with your coding agent.
ShopCheckout.jsxshop-checkout.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/rolling-number/ui/alert-banner/ui/shake-feedback/ui/success-check/ui/checkbox/ui/form-field/ui/radio-group/ui/text-input/ui/skeleton-shimmer/ui/step-progress/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
