Skip to Content
Docs

Saved payment methods

Style the saved cards section, individual card rows, the CVV re-entry field, and the delete confirmation UI in the Universal checkout form.

When a returning customer has saved cards on file, the checkout form displays a dedicated section for them. You can style the section container, the individual card rows, and the interactions around selecting or removing a saved card.

Universal checkout with a saved Visa card selected

Section container

The savedPaymentMethods key controls the outer container that wraps the entire saved cards section:

style: {
  savedPaymentMethods: {
    backgroundColor: '#f9fafb',
    borderRadius: '12px',
    padding: '16px',
  }
}

Card rows

Use existingSource to control how each saved card row looks. The base sub-key styles the default state of each row. The ':selected' key inside it styles the currently active row:

style: {
  existingSource: {
    base: {
      backgroundColor: '#f3f4f6',
      borderRadius: '8px',
      ':selected': {
        backgroundColor: '#eff6ff',
        border: '1px solid #3b82f6',
      }
    },
    radioButton: {
      color: '#d1d5db',
      ':selected': {
        color: '#2563eb',
      }
    }
  }
}

':selected' is a plain object key, not a CSS pseudo-class. It must be written as a string including the quotes.

CVV re-entry field

When a customer selects a saved card, the form may show a CVV input for re-verification. Use existingSource.cvv to style that field and its error message:

style: {
  existingSource: {
    cvv: {
      style: {
        border: '1px solid #d1d5db',
        borderRadius: '8px',
      },
      errorMessageStyle: {
        color: '#ef4444',
        fontSize: '12px',
      }
    }
  }
}

To style the CVV label, use cardForm.formConfig.cvv.labelStyle on checkout.universal() (outside the style object). See Customize field labels, placeholders, and error messages.

Delete icons and confirmation text

When a customer removes a saved card, the form shows delete, confirm, and cancel icons alongside a confirmation message. Use existingSource.icons and existingSource.deleteText to style these states:

style: {
  existingSource: {
    icons: {
      delete: {
        color: '#9ca3af',
      },
      confirmDeletion: {
        color: '#ef4444',
      },
      cancelDeletion: {
        color: '#6b7280',
      }
    },
    deleteText: {
      color: '#374151',
      fontSize: '13px',
    }
  }
}

Next steps

Was this page helpful?