ValyroUI Русская версия

Checkout Summary

Order summary at checkout. Pro · Shop and payments › Cart and orders

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add checkout-summary
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { CheckoutSummary } from 'valyro-ui-pro';

Props

PropTypeDefault
items *CartLineItem[]Order lines (read-only here) that make up the subtotal; with none the checkout button is disabled.
currencystring'USD'ISO 4217 code for every amount; also shown before the total.
shippingnumberMinor units; 0 shows "Free", undefined shows "Calculated at next step".
taxRatenumber0Fraction applied to the discounted subtotal, e.g. 0.0825.
promoPromoCode | nullControlled promo; use with onPromoChange.
defaultPromoPromoCode | nullnullInitial promo when uncontrolled.
onPromoChange(promo: PromoCode | null) => voidCalled with the new promo when it changes.
onApplyPromo(code: string) => PromoCode | Promise<PromoCode>Validates a code and resolves to the promo to apply. Throw (or reject) with an Error to reject the code — its message is shown under the field. Omit to hide the field.
onCheckout(totals: OrderTotals) => voidCalled by the checkout button with the computed subtotal, discount, shipping, tax and total.
ctaLabelReactNode'Place order'Text of the checkout button.
titleReactNode'Order summary'Summary heading; also its accessible name.
stickybooleanfalseKeeps the summary in view while the page scrolls (viewports ≥1024px), for a sidebar next to a long checkout form. Its container must not contain content below it.
localestringLocale for prices (default: the ThemeProvider's, then the browser's).
labelsPartial<CheckoutSummaryLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Shopping Cart Drawer · Next: Checkout Form · All Shop and payments