Checkout

Checkout flow on Stepper — shipping with a gliding delivery-speed choice, display-only payment fields and an editable review — beside an order summary with compact quantity steppers, a promo code that shakes when invalid and pops a removable badge when valid, and subtotal, discount, tax and total that roll on every change.

Preview

Checkout preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/checkout
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

items?
CheckoutItem[]
—
defaultItems?
CheckoutItem[]
[]
onItemsChange?
((items: CheckoutItem[]) => void)
—
promoCodes?
CheckoutPromo[]

Known codes (case-insensitive) when `onApplyPromo` isn't given.

[]
onApplyPromo?
((code: string) => Promise<CheckoutPromo>)

Async promo check. Resolve with the promo, reject to mark the code invalid.

—
onComplete?
((order: CheckoutOrder) => string | Promise<string>) | undefined

Places the order. Card fields are UI only and never included — wire a payment provider's hosted fields for real card entry. Resolve with an order reference to show it; reject to show the message on the review step.

—
taxRate?
number

Sales tax rate (0.08 = 8%). Default 0.08.

0.08
expressPrice?
number

Express delivery price in major units. Default 15.

15
currency?
string
USD
locale?
string
en-US
className?
string
—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated