Skip to content
English
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

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and sample order.
itemsArray<{ id, name, variant, price, qty, image? }>sample bagThe 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.
currencystringby localeISO currency code for every amount.
methodsArray<{ id, label, eta, price }>standard and expressWays of delivery. The first one is free from `freeFrom`; the others always cost their price.
freeFromnumberby localeSubtotal from which the first way of delivery is free.
customer{ name, phone, region, street } | nullsample customerFills the delivery step for a returning customer; null starts it blank.
card{ last4, expiry } | nullsample cardA saved card offered first; null asks for a new card.
loadingbooleanfalseShows the skeleton of the checkout while it loads.
errorboolean | stringfalseShows 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.
labelsobject—Replaces any built-in text (keys as in copy.js), including field names and error messages.
classNamestring—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.