Back to components

Checkout

Checkout Form

A payment-agnostic checkout: contact and shipping fields with validation, a slot for your payment provider UI, an order summary, and submit states. Wire your own PSP.

form
validation
accessible

Preview

Checkout

  • Aurora lamp1

    Aurora Lamp

    $129.00
Subtotal$129.00
Total$139.32

Installation

Run the shadcn CLI. Dependencies and the shared lib block come with it.

npx shadcn add checkout-form

Usage

Import
import { CheckoutForm } from "@/components/lumo/checkout-form"
Example
<CheckoutForm
  lines={lines}
  subtotal={subtotal}
  total={total}
  paymentSlot={<StripeElements />}
  onSubmit={async (values) => createOrder(values)}
/>

Props

PropTypeDefaultRequired
linesCartLine[]-
Required
subtotalMoney-
Required
shippingMoney-
taxMoney-
totalMoney-
paymentSlotReactNode-
onSubmit(values: CheckoutValues) => void | Promise<void>-
submitLabelstring"Place order"

All props accept standard HTML attributes unless otherwise specified.

Dependencies

Lumo blocks

npm packages

react-hook-formzod@hookform/resolvers

Own every line

Lumo blocks copy into your repo. No runtime dependency, no lock-in. Edit the code to fit your product.