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.

Configure payment methods (Payment Methods List only)

When using the Payment Methods List, you can control which payment methods are displayed and in what order. These options only apply to the Payment Methods List — they have no effect on the Card Form or Wallet Buttons.

info

Apple Pay and Google Pay in the Payment Methods List do not show the default Wallet Buttons. You might want to combine the Payment Methods List with the Wallet Buttons to display the native Apple Pay and Google Pay buttons.

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.

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.

Exclude payment methods

Use excludedPaymentMethods to prevent specific payment methods from appearing:

const paymentMethodsList = components.create("payment-methods-list", {
excludedPaymentMethods: ["paypal", "trustly"]
});

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", {
paymentMethodOrder: ["card", "ideal"],
excludedPaymentMethods: ["paypal"],
visibleItemsCount: 4
});
paymentMethodsList.mount("#payment-methods-list");

Available payment method IDs

IDName
cardCard payments (Visa, Mastercard)
applepayApple Pay
googlepayGoogle Pay
idealiDEAL
bancontactBancontact
paypalPayPal
epsEPS
trustlyTrustly
mbwayMB Way
mybankMyBank
satispaySatispay
alipayAlipay
wechatpayWeChat Pay

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
}
}
});