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

Purchase Card

Product purchase: banner, one-time payment or subscription, card and address. Pro · Shop and payments › Payments and wallet

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add purchase-card
npm install valyro-ui-pro

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

Props

PropTypeDefault
title *ReactNodeProduct name.
descriptionReactNodeOne or two lines about what is bought.
imageSrcstringRound picture over the banner: the author, the product icon.
imageNamestringName for the picture's initials fallback.
bannerstringAny CSS background for the banner. Default: a pink-to-blue gradient.
modesPurchaseMode[][]Payment options (one-time, subscription); the switcher shows with two or more.
modestringChosen option (controlled).
defaultModestringInitial mode when uncontrolled.
onModeChange(mode: string) => voidCalled with the new mode when it changes.
pricenumber0Price when there are no modes.
currencystring'USD'ISO 4217 code. Default USD.
countries *SelectItem[]Countries for the billing address.
valuePurchaseFieldsThe typed fields (controlled), e.g. to prefill the email or keep them across steps.
defaultValuePurchaseFieldsInitial value when uncontrolled.
onValueChange(value: PurchaseFields) => voidCalled with the new value when it changes.
onSubmit(value: PurchaseValue) => voidCalled once every field passes validation.
submittingbooleanfalseShows the pay button as busy.
headingLevel1 | 2 | 3 | 4 | 5 | 62Level of the product name (default 2).
localestringBCP 47 locale for the price.
labelsPartial<PurchaseCardLabels>Overrides for the built-in English text; keys left out keep their defaults.
cardLabelsPartial<CardInputLabels>Strings of the card field.

Related components

Previous: Wallet Balance · Next: Loyalty Rewards · All Shop and payments