v1.18.0 - Set the card form's placeholder text with the new cardFieldPlaceholders prop #
Choose the placeholder text of the hosted card number, expiry, security code and name fields with the new `cardFieldPlaceholders` prop. It is available on the embedded checkout and on SplitCardForm in @flopay/react and @flopay/vue. Nothing changes unless you set it.
24 Nov 2026
New Feature
JavaScript SDK
React SDK
Vue SDK
Choose the placeholder text of the hosted card fields with the new cardFieldPlaceholders prop. You can match the card form's wording to your own checkout language and tone without building a custom card form.
What changed
- React and Vue. The embedded checkout component and
SplitCardFormin@flopay/reactand@flopay/vueacceptcardFieldPlaceholders, an object with optionalnumber,expiry,cvvandnametext. The embedded checkout forwards the prop to its built-in card form; aSplitCardFormyou render in a custom layout takes its owncardFieldPlaceholders. - Only what you set. A field you leave out keeps the hosted form's own wording. An empty string (
'') shows no placeholder in that field. The text is sent as given, with no trimming or validation in the SDK; the hosted form enforces its own length limit and shows the text literally, never as markup. - Live updates. Changing the prop updates the card form in place, without remounting it or clearing card details the buyer has already entered. The comparison is by content, so passing a new object with the same text on each render sends nothing more. The latest text is sent again whenever the hosted form reloads, and removing the prop restores the hosted form's wording.
@flopay/js. The hosted card capture addssetCardFieldPlaceholders(placeholders), which sets the placeholder text live. The optionalsetCardFieldPlaceholderscontrol and theCardFieldPlaceholderstype are also in@flopay/shared.- Security. Like the submit label, the text is sent only to the hosted form's exact origin, bound to the checkout session.
Integration notes
- No action is needed. When the prop is not set, nothing is sent and the card form looks and behaves exactly as before.
- To change the wording, add
cardFieldPlaceholdersto the embedded checkout component orSplitCardForm, for example{ number: 'Card number', expiry: 'MM / YY', cvv: 'CVC', name: 'Name on card' }. The@flopay/react,@flopay/vueand@flopay/jsREADMEs show the details. - Placeholder colour and font still come from your existing theme settings.