Skip to main content

Customize

This page explains how to customize the Checkout Components, including configuring which payment methods are displayed and styling the components to match your brand.

Filter payment methods

Each component supports only and exclude options to control which payment methods are displayed. You can use one or the other, but not both — the SDK throws an error if both are set.

info

The displayed payment methods are always the intersection of the payment methods configured on your account and any filters you provide. If you specify a payment method that is not enabled on your account, it will not be shown.

Allow-list with only

Use only to show specific payment methods and hide everything else. This is useful when you know exactly which methods to offer for a transaction.

const paymentMethodsList = components.create("payment-methods-list", {
only: ["card", "ideal"]
});
const walletButtons = components.create("wallet-buttons", {
only: ["applepay"]
});
const cardForm = components.create("card-form", {
only: ["visa", "mastercard"]
});
warning

With only, new payment methods added to your account won't appear until you update the list. Use exclude if you want new methods to appear automatically.

Exclude with exclude

Use exclude to hide specific payment methods while showing everything else. New payment methods added to your account appear automatically.

const paymentMethodsList = components.create("payment-methods-list", {
exclude: ["paypal", "trustly"]
});
const walletButtons = components.create("wallet-buttons", {
exclude: ["googlepay"]
});
const cardForm = components.create("card-form", {
exclude: ["visa"]
});

Available payment method IDs

IDName
cardCredit/Debit card (all brands)
visaVisa
mastercardMastercard
applepayApple Pay
googlepayGoogle Pay
idealiDEAL
bancontactBancontact
paypalPayPal
epsEPS
trustlyTrustly
mbwayMB Way
mybankMyBank
satispaySatispay
alipayAlipay
wechatpayWeChat Pay

Configure Payment Methods List

These options only apply to the Payment Methods List component.

info

Apple Pay and Google Pay in the Payment Methods List do not show the native Wallet Buttons. Combine the Payment Methods List with the Wallet Buttons component to display native Apple Pay and Google Pay buttons.

Order payment methods

Use paymentMethodOrder to specify which payment methods appear first:

const paymentMethodsList = components.create("payment-methods-list", {
paymentMethodOrder: ["card", "ideal", "applepay"]
});

Payment methods in this array are shown first in the specified order. Any other available methods appear after. If you specify payment methods that aren't available, they're ignored.

Control visible items

Use visibleItemsCount to set how many payment methods are visible before "Show more" appears (default: 5):

const paymentMethodsList = components.create("payment-methods-list", {
visibleItemsCount: 3
});

Combined example

const paymentMethodsList = components.create("payment-methods-list", {
exclude: ["paypal"],
paymentMethodOrder: ["card", "ideal"],
visibleItemsCount: 4
});
paymentMethodsList.mount("#payment-methods-list");

Localization

The SDK supports multiple languages for form labels, placeholders, validation messages, and error messages. Set the locale option when initializing the SDK. By default the SDK uses 'auto' which sets the language based on the customer's browser settings.

const rootline = new Rootline({
locale: "de"
});

Supported locales

LocaleLanguage
autoAutomatically sets the language based on the customer's browser settings. If the browser language is not supported, English is used as the default.
enEnglish
deGerman
nlDutch

What gets localized

  • Card Form labels (Card number, Expiry date, Security code, Name on card)
  • Placeholder text
  • Validation error messages
  • Payment method names in the payment-methods-list
  • SDK error messages

Customize appearance

The Checkout Components can be styled to match your brand. You can customize colors, fonts, border radii, and more using the appearance configuration.

Setting appearance

Pass the appearance object when initializing components:

const rootline = new Rootline();
const components = rootline.components("checkout", {
accountPublishableKey: "YOUR_ACCOUNT_PUBLISHABLE_KEY",
amount: "10.00",
currency: "EUR",
appearance: {
theme: "light",
variables: {
colorPrimary: "#007bff",
colorBackground: "#ffffff",
controlBorderRadius: "8px"
}
}
});

Updating appearance dynamically

You can update the appearance after initialization without remounting components:

components.update({
appearance: {
theme: "dark",
variables: {
colorPrimary: "#ff5722"
}
}
});

Themes

The SDK includes built-in themes that set sensible defaults for all variables:

ThemeDescription
lightLight background with dark text (default)
darkDark background with light text
appearance: {
theme: "dark"
}

Variables

Override individual style properties using variables:

Colors

VariableDescription
colorPrimaryPrimary button and accent color
colorPrimaryForegroundText color on primary elements
colorForegroundMain text color
colorMutedForegroundSecondary/muted text color
colorBackgroundBackground color
colorSuccessSuccess state color
colorWarningWarning state color
colorErrorError state color

Colors accept hex (#007bff), rgb (rgb(0, 123, 255)), rgba, hsl, or hsla formats.

appearance: {
variables: {
colorPrimary: "#007bff",
colorError: "#dc3545",
colorBackground: "#f8f9fa"
}
}

Border radius

VariableDescription
controlBorderRadiusBorder radius for input fields and buttons
panelBorderRadiusBorder radius for panels and cards

Values can be a string with units ("8px", "0.5rem") or a number (interpreted as pixels).

appearance: {
variables: {
controlBorderRadius: "8px",
panelBorderRadius: "12px"
}
}

Typography

VariableDescription
fontFamilyFont family for all text
fontSizeDefaultBase font size
fontSizeSmallSmall text size
fontSizeLargeLarge text size
fontWeightNormalNormal font weight
fontWeightMediumMedium font weight

Font sizes accept strings with units ("16px", "1rem") or numbers (interpreted as pixels). Font weights accept numbers (400, 500) or keywords ("normal", "bold").

appearance: {
variables: {
fontFamily: "'Inter', sans-serif",
fontSizeDefault: "16px",
fontWeightMedium: 500
}
}

Custom fonts

Load custom fonts using the fonts array. The SDK supports two methods:

Load fonts from a CSS URL, such as Google Fonts:

appearance: {
fonts: [
{
type: "css",
href: "https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
}
],
variables: {
fontFamily: "'Roboto', sans-serif"
}
}

File fonts

Load self-hosted font files:

appearance: {
fonts: [
{
type: "file",
family: "CustomFont",
src: "https://your-domain.com/fonts/custom.woff2",
weight: 400,
style: "normal"
}
],
variables: {
fontFamily: "'CustomFont', sans-serif"
}
}
warning

Font URLs must use HTTPS.

Complete example

const rootline = new Rootline();
const components = rootline.components("checkout", {
accountPublishableKey: "YOUR_ACCOUNT_PUBLISHABLE_KEY",
amount: "10.00",
currency: "EUR",
appearance: {
theme: "light",
fonts: [
{
type: "css",
href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"
}
],
variables: {
// Colors
colorPrimary: "#6366f1",
colorPrimaryForeground: "#ffffff",
colorForeground: "#1f2937",
colorMutedForeground: "#6b7280",
colorBackground: "#ffffff",
colorError: "#ef4444",

// Border radius
controlBorderRadius: "8px",
panelBorderRadius: "12px",

// Typography
fontFamily: "'Inter', sans-serif",
fontSizeDefault: "16px",
fontWeightNormal: 400,
fontWeightMedium: 500
}
}
});