Skip to Content
Docs

Style the drop-in

Set the drop-in's colors for light and dark mode, its corners, borders, text size, Pay button, and card inputs.

By default, the drop-in follows the platform's native look, using system colors that adapt to light and dark mode, the app's tint on iOS or theme primary color on Android, and system fonts and lists. The appearance option of checkout.presentDropIn() changes that look. preset: 'web' starts from the look of Universal checkout in Pay.com.js instead, and anything else you set applies on top of the preset. The method rows always show Pay.com's logos.

Colors must be plain values (a hex string such as '#0D6B57', a color name, or a number). A PlatformColor or a dynamic color isn't supported, so give dark mode its own colors in colorsDark. Sizes are in points on iOS and dp on Android.

const result = await checkout.presentDropIn({
  appearance: { colors: { primary: '#0D6B57' }, cornerRadius: 12 },
})

Parameters

ParameterTypeRequiredDescription
preset'system' | 'web'No'system', the platform's look, or 'web', the look of Universal checkout in Pay.com.js. Default: 'system'.
colorsPayDropInColorsNoThe colors in light mode, and in dark mode for any color colorsDark doesn't set. See Colors.
colorsDarkPayDropInColorsNoThe colors in dark mode.
cornerRadiusnumberNoThe lists' corner radius.
borderWidthnumberNoThe width of a border around each list, in the separator color.
fontScalenumberNoMultiplies every text size. It must be above 0, and the customer's text size setting still applies.
primaryButtonPayDropInPrimaryButtonNoThe Pay button. See Pay button.
rowStyle'checkmark' | 'radio'NoHow the selected method is marked. Default: 'checkmark' on iOS, 'radio' on Android.
fieldStylePayFieldStyleNoThe card inputs, as for the card fields. Its colors are the same in light and dark mode. To keep dark mode, set colors instead.
applePayButtonStyle'automatic' | 'black' | 'white' | 'whiteOutline'NoThe Apple Pay button's style (iOS only). Default: 'automatic', which follows light and dark mode.

Colors

colors and colorsDark are PayDropInColors. Each color is an optional ColorValue, and one you leave out comes from the preset.

Parameter'web'What it colors
primary#1E1E1EThe selection, the Pay button, the card inputs' cursor, and the save-card switch when it's on. On Android, also Edit, Done, and a focused field's outline and label. On iOS, the switch stays the system's green until you set primary. Default: the app's tint on iOS, or its theme's primary color on Android.
onPrimary#FFFFFFThe Pay button's text and spinner.
background#FFFFFFThe sheet, behind the lists and the Pay button. On Android, also behind the card fields, which are outlined on it.
surface#FFFFFFThe method lists and the save-card switch's row. On iOS, also the card form.
text#1E1E1EThe title, the rows, what's typed in the card inputs, the switch's label, and the failure message. On iOS, the title follows it only with the web preset or once you set background.
secondaryText#6B6B6BThe section headers, subtitles, the default badge, and "or". On Android, also unselected radio buttons, and the fields' labels and placeholders.
separator#D5D5D5The lines between rows and beside "or", and the lists' borders. On iOS, also unselected radio circles and the lines between fields. On Android, also the field outlines.
error#D9372DThe errors under the fields, invalid card details, and the failure message's icon and tinted background. On Android, also the remove buttons.

The web look

preset: 'web' is white, with bordered lists, corners of 8, and a near-black Pay button 48 high. It's light only. Some of its parts differ by platform:

  • On iOS, rows have radio circles and Apple Pay's button is black. The Pay button has colors of its own, so set primaryButton.backgroundColor along with colors.primary.
  • On Android, the card fields have a style of their own, with a #6663D8 outline when focused, so set fieldStyle to change them.

preset: 'system' on the left and preset: 'web' on the right, on iOS, then on Android:

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). Illustration of the Android drop-in for a new customer twice: on the left with Material 3's default look (tinted sheet, purple radios and Pay button), on the right with the Web preset (white sheet, bordered lists with small corners, black radios, near-black Google Pay and Pay buttons).

Pay button

primaryButton is a PayDropInPrimaryButton. A value you leave out follows the platform's button.

ParameterTypeRequiredDescription
backgroundColorColorValueNoThe button's color.
textColorColorValueNoThe label's color.
borderColorColorValueNoThe border's color.
borderWidthnumberNoThe border's width.
cornerRadiusnumberNoThe corner radius. Default: a capsule on Android and iOS 26, and the system's rounded corners on earlier iOS versions.
heightnumberNoThe button's minimum height.

Errors

presentDropIn() rejects with a TypeError before the sheet opens when a value has an invalid type or range, such as a non-plain color, a size below 0, a fontScale of 0, or a preset, rowStyle, or applePayButtonStyle outside the allowed values.

Example

const result = await checkout.presentDropIn({
  merchantDisplayName: 'My Shop',
  appearance: {
    colors: { primary: '#0D6B57', background: '#F4F6F5', surface: '#FFFFFF', text: '#1B1F1D' },
    colorsDark: { primary: '#4FC3A1', background: '#000000', surface: '#1C1F1E', text: '#F4F6F5' },
    cornerRadius: 12,
    fontScale: 1.1,
    primaryButton: { cornerRadius: 8, height: 50 },
    rowStyle: 'radio',
  },
})

Next steps

Was this page helpful?