Examples
Checkout Pro
One screen from the bag to Pay: the order, the address, delivery speed as radio buttons, the payment method, a promo code, and totals with tax that update as you choose, in your currency. The pay button is busy until onPay resolves. Try the code SAVE10.
import { CheckoutScreen } from '@patine-ui/pro';
Loading…
<CheckoutScreen items={CHECKOUT_ITEMS} shippingOptions={SHIPPING_OPTIONS} address="Rua Augusta 12, Lisbon" paymentMethod="Visa ·· 4242" taxRate={0.08} onApplyPromo={(code) => (code.toUpperCase() === 'SAVE10' ? 1000 : null)} onPay={() => wait(900)} />
Make it yours
| Prop | Type | Default |
|---|---|---|
items | { id, name, variant?, quantity, price }[], prices in cents | Required |
shippingOptions | { id, title, … }[] | Required |
address, paymentMethod | string | Required |
taxRate | number: 0.23 for 23% | 0 |
currency, locale | ISO 4217, BCP 47 | 'USD', the device's |
onApplyPromo | (code) => cents | null | No promo field |
onPay | ({ shippingId, totals }) => void | Promise<void> | Required |
onEditAddress, onEditPayment, onBack | () => void | None |
For a multi-step checkout, see Ouro's, built on the Wizard.
Built from the free List, RadioGroup, TextField and Header.
In real apps
Every complete app has its own version of this screen, wired to its auth, data and settings: see the templates.
Related
- Paywall PRO
- Order tracker PRO
- All blocks