Skip to Content
Docs

Style the drop-in

Change the drop-in's colors, fonts, list shapes, Pay button, and method icons, or start from Pay.com's web look.

PayDropInAppearance sets how the drop-in looks. Its defaults follow the system appearance, using dynamic colors for light and dark mode, your app's tint for the selection and Pay button, system fonts with Dynamic Type, and inset-grouped lists. Method rows show Pay.com's logos. Change the properties you want, or start from PayDropInAppearance.web, the look of Universal checkout in Pay.com.js, and pass it as the configuration's appearance.

Colors are UIColor values, so a dynamic color, such as one from your asset catalog, keeps its own light and dark values. PayDropInAppearance is a struct used on the main actor.

var appearance = PayDropInAppearance()
appearance.colors.primary = .systemIndigo
configuration.appearance = appearance

Properties

PropertyTypeDefaultDescription
colorsPayDropInAppearance.ColorsSystem colorsThe sheet's colors. See Colors.
fontPayDropInAppearance.FontThe system fontSets the sheet's typography. base is the font used for sizes and weights (nil uses the system font), and sizeScale multiplies every text size on top of Dynamic Type. Default: Font(base: nil, sizeScale: 1).
cornerRadiusCGFloat?nilThe lists' corner radius. Uses the system's inset-grouped radius when nil.
borderWidthCGFloat0A border around each list in colors.separator. 0 draws no border, matching system lists.
shadowPayDropInAppearance.Shadow?nilA shadow under each list, with color (default black), opacity (0.08), offset (0 by 2), and radius (6). Draws no shadow when nil.
primaryButtonPayDropInAppearance.PrimaryButtonThe system styleThe Pay button. See Pay button.
rowStylePayDropInAppearance.RowStyle.checkmarkHow the selected method is marked (.checkmark on the selected row, as in Settings, or .radio for a radio circle on every row).
methodIcons[String: UIImage][:]Your own icons for method rows, by API type, for example your artwork for paypal. They're drawn in their own colors, at up to 40 by 28 points. A type without one shows Pay.com's logo for the method, or its monogram.
fieldStylePayFieldStyle?nilThe card inputs' style. See Style the card fields. When nil, inherits colors and font without individual borders because the form draws the lines between fields.
applePayButtonStylePKPaymentButtonStyle.automaticThe Apple Pay button's style. .automatic follows light and dark mode, and .black, .white, and .whiteOutline don't. Its height and corners follow primaryButton.
resolvedFieldStylePayFieldStyleRead-only resolved style for the card inputs, using fieldStyle or the style derived from colors and font.

Colors

Each color defaults to a system color, and .web sets a fixed one.

PropertyDefault.webWhat it colors
primary.tintColor#1E1E1EThe selection mark, the Pay button, and the card inputs' cursor. Once you change it, also the save-card switch when it's on, which is the system's green otherwise.
onPrimary.white#FFFFFFThe Pay button's text and spinner.
background.systemGroupedBackground#FFFFFFThe sheet, with its title bar and the bar behind the Pay button.
surface.secondarySystemGroupedBackground#FFFFFFThe method lists, the card form, and the save-card switch's row.
text.label#1E1E1EThe rows' titles, what's typed in the card inputs, the switch's label, and the failure message. The sheet's title too, once you change background or the base font.
secondaryText.secondaryLabel#6B6B6BThe section headers, subtitles, the default badge, "or", and the spinner on a row that's being removed.
placeholder.placeholderText#ACACACThe card inputs' placeholders.
separator.separator#D5D5D5The lines between rows, between fields, and beside "or", the lists' borders, and unselected radio circles.
error.systemRed#D9372DThe errors under the fields, invalid card details, and the failure message's icon and tinted background. The remove controls stay the system's red.

Pay button

primaryButton styles the Pay button.

PropertyTypeDefaultDescription
backgroundColorUIColor?nilButton background color. Uses colors.primary when nil.
textColorUIColor?nilButton text and spinner color. Uses colors.onPrimary when nil.
cornerRadiusCGFloat?nilButton corner radius. Uses the system shape (capsule on iOS 26 and later, rounded on earlier versions) when nil.
borderColorUIColor?nilDrawn when borderWidth is above 0.
borderWidthCGFloat0Border width around the button.
heightCGFloat50The minimum height. The Apple Pay button takes it too.
fontUIFont?nilButton label font. Uses the system font when nil.

On iOS 26 and later, the Pay button uses the system's Liquid Glass style. Set any of its colors, cornerRadius, a border, or font, and it's drawn with those instead.

The web look

PayDropInAppearance.web matches the look of Universal checkout in Pay.com.js, featuring white surfaces, bordered lists with 8-point corners, a near-black Pay button 48 points tall, radio rows, and a black Apple Pay button. Its colors are fixed, so they don't follow dark mode. Its Pay button has colors of its own. To change them, set primaryButton.backgroundColor and primaryButton.textColor along with primary and onPrimary.

The system look, and PayDropInAppearance.web:

Illustration of the iOS drop-in for a new customer twice: on the left with the system look (gray sheet, rounded lists, checkmark, blue Pay button), on the right with the Web preset (white sheet, bordered lists with small corners, radios, near-black Apple Pay and Pay buttons).

Example

import PayDropIn
import UIKit

var appearance = PayDropInAppearance.web
appearance.colors.primary = UIColor(named: "Brand") ?? .systemIndigo
appearance.primaryButton.backgroundColor = appearance.colors.primary
appearance.font = PayDropInAppearance.Font(base: UIFont(name: "AvenirNext-Regular", size: 17))
if let logo = UIImage(named: "PayPalLogo") {
    appearance.methodIcons["paypal"] = logo
}

let dropIn = PayDropIn(checkout: checkout, configuration: .init(appearance: appearance))

Next steps

Was this page helpful?