Skip to Content
Docs

Style object reference

Complete reference for all keys accepted by the style parameter in checkout.universal().

The style parameter in checkout.universal() accepts a plain JavaScript object. Each key targets a specific region of the checkout form. All CSS property names must be in camelCase (for example, borderRadius, not border-radius). Values that aren't valid CSS properties are silently ignored.

For examples of how to apply these styles, see Customize the checkout.

Top-level keys

The style object accepts these keys at its top level. Simple keys accept CSS properties directly. Object keys have their own sub-keys, listed in Sub-key reference.

KeyTypeDescription
baseCSS propertiesOutermost wrapper of the entire form. Styles cascade into child regions unless a more specific key overrides them.
submitCSS propertiesMain submit button at the bottom of the checkout form (the "Pay" button).
savedPaymentMethodsCSS propertiesContainer wrapping the saved payment methods section. Only visible when the customer has saved cards.
expressCheckoutCSS propertiesContainer wrapping the alternative payment method buttons (for example, Neosurf and paysafecard), the "Pay with" and "Pay with card" dividers, and the card form.
apmButtonsCSS propertiesContainer wrapping wallet buttons (Google Pay and Apple Pay).
cardFormObjectCard input fields, checkboxes, and related elements. Nested inside expressCheckout.
dividersObjectHorizontal divider lines with text labels that separate form sections.
existingSourceObjectSaved card rows, radio buttons, CVV re-entry field, and deletion UI.
paymentMethodFieldsObjectInput fields that APMs render in the radio layout (alternatives: 'radio'), for example the iDEAL bank selector.

Sub-key reference

Each object key takes the sub-keys in its section.

Card form fields (cardForm)

Controls the card input fields and checkboxes. Styles applied to base affect all four card fields as a group. Use individual field keys to target each field separately.

The color property on number, cvv, expiry, and name targets input text only. To style field labels, use cardForm.formConfig, which is a separate top-level parameter on checkout.universal() and not part of the style object.

KeyTypeDescription
baseCSS propertiesShared container around all four card fields.
numberCSS propertiesCard number input field (input text and background only).
cvvCSS propertiesCVV input field (input text and background only).
expiryCSS propertiesExpiration date input field (input text and background only).
nameCSS propertiesCardholder name input field (input text and background only).
number[':focus']{ borderColor: string }Focus state for the card number field. Sets the focus border color and tints the focus ring to match. Only borderColor is read. Error and warning states take priority.
expiry[':focus']{ borderColor: string }Focus state for the expiration field. Same behavior as number[':focus'].
cvv[':focus']{ borderColor: string }Focus state for the CVV field. Same behavior as number[':focus'].
name[':focus']{ borderColor: string }Focus state for the cardholder name field. Same behavior as number[':focus'].
submitCSS propertiesReserved for the submit button inside the card form.
checkboxes.buttonBackgroundstringBackground color of checkbox buttons, for example "Save card for future use".
checkboxes.labelColorstringText color of checkbox labels.

Card form configuration (cardForm.formConfig)

formConfig is passed directly inside cardForm on checkout.universal(). It isn't part of the style object. Use it to control labels, placeholders, error message styles, and input sizes for each card field.

checkout.universal({
  container: '#payment_container',
  cardForm: {
    formConfig: { ... }
  }
})

formConfig.base accepts these keys:

KeyTypeDescription
formTitlestringTitle displayed at the top of the card form section.
titleStylesCSS propertiesStyle for the form title text.
inputSpacingstringVertical spacing between fields, for example '16px'.

To style the wrapper around the card fields, use style.cardForm.base.

formConfig.number, formConfig.expiry, formConfig.cvv, formConfig.name each accept:

KeyTypeDescription
labelstringLabel text shown above the input.
labelStyleCSS propertiesColor, font size, weight, and other styles for the label.
placeholderstringPlaceholder text shown inside the input when empty.
errorMessageStyleCSS propertiesStyle for the inline validation error message.
inputSize'small' | 'medium' | 'large'Controls the height of the input field.
styleCSS propertiesAdditional styles applied to the input element itself.

Section dividers (dividers)

Controls the horizontal lines with text labels that separate sections of the checkout form.

KeyDescription
dividers.payWith"Pay with" divider between the wallet button and the alternative payment method buttons.
dividers.payWithCard"Pay with card" divider between the alternative payment method buttons and the card form.
dividers.savedPaymentMethods"Saved payment methods" divider above the saved payment methods list. Only visible when the customer has saved cards.
dividers.showOtherWaysToPay"Show other ways to pay" divider that appears when a customer has saved cards. Clicking it expands the full form with APMs and the card form.

Each divider accepts these sub-keys:

Sub-keyTypeDescription
textCSS propertiesText label displayed on the divider.
dividerCSS propertiesThe horizontal line, including color and height.

Saved card rows (existingSource)

Controls how saved card rows and their related UI appear when a returning customer has stored payment methods.

':selected' and ':disabled' are plain object keys, not CSS pseudo-classes. Write them as strings including the quotes, as in ':selected'.

KeyTypeDescription
baseCSS propertiesDefault appearance of each saved card row.
base[':selected']CSS propertiesAppearance of the currently selected saved card row.
radioButton.colorstringDefault color of the radio button.
radioButton[':selected'].colorstringColor of the radio button when that card row is selected.
cvv.styleCSS propertiesCVV re-entry input field shown when a saved card is selected.
cvv.errorMessageStyleCSS propertiesValidation error text below the CVV field.
icons.deleteCSS propertiesDelete icon in its default state.
icons.confirmDeletionCSS propertiesConfirm icon shown when the customer starts a deletion.
icons.cancelDeletionCSS propertiesCancel icon shown when the customer starts a deletion.
deleteTextCSS propertiesConfirmation message shown when the customer starts a deletion.

To style the label of the CVV re-entry field, use cardForm.formConfig.cvv.labelStyle, which is outside the style object.

APM input styles (paymentMethodFields)

Styles the input fields that APMs render in the radio layout (alternatives: 'radio' on checkout.universal()). It has no effect in the default button layout.

KeyTypeDescription
labelCSS propertiesLabels above APM input fields.
inputCSS propertiesText input fields.
dateCSS propertiesDate input fields.
radio.colorstringColor of radio button indicators.
radio.labelCSS propertiesLabels next to radio buttons.
selectCSS-in-JS propertiesSelect (dropdown) elements.
checkboxObjectCheckbox elements.

Next steps

Was this page helpful?