Skip to content

PayUI Customisation

PayUI supports comprehensive visual customisation through CSS custom properties, allowing you to match the payment form to your brand identity.

Theme Options

PayUI supports two built-in themes:

ui: { theme: "light" } // Light theme (default)
ui: { theme: "dark" } // Dark theme

CSS Custom Properties

Customise the appearance using CSS variables in the ui.variables object. All variables support both light and dark themes automatically.

Layout note: PayUI uses an optimized, responsive layout for payment fields. Customisation is visual (colors, spacing, typography), not structural (field order or column layout).

Brand Colors

VariableDefault (Light)Default (Dark)Description
colorPrimary#0074C7#4f96ffPrimary brand color (buttons, links, focus)
colorPrimaryHover#005C9E#3b82f6Primary hover state
colorPrimaryActive#004A80#2563ebPrimary active/pressed state
colorSecondary#6E7087#64748bSecondary accent color
colorBackground#FFFFFF#0f172aMain background
colorText#242729#f8fafcPrimary text
colorTextSecondary#6E7087#94a3b8Secondary text
// Example: Orange brand theme
variables: {
colorPrimary: '#FF4500',
colorPrimaryHover: '#E13E00',
colorPrimaryActive: '#CC3700'
}

Typography

VariableDefaultDescription
fontFamilyui-sans-serif, system-ui, sans-serifPrimary font family
fontSizeBase14.22pxBase font size
fontWeightMedium500Medium weight for labels
fontWeightNormal400Normal font weight

Important: Only use system fonts for fontFamily. Loading external web fonts from CDNs is not supported to maintain PCI compliance and iframe security. You may specify brand fonts (for example, Inter) but they will only render if the font is already installed on the customer’s device.

Example system font stacks:

  • Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif
  • "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif

Form Controls

VariableDefault (Light)Default (Dark)Description
inputHeight40pxSameInput field height
inputPadding8pxSameInput internal padding
inputBackground#FFFFFF#1e293bInput background
inputBorderColor#707689#475569Input border color
inputBorderColorHover#245B9C#64748bInput border on hover
inputPlaceholderColor#717688#94a3b8Placeholder text color
borderRadius2pxSameCorner radius
borderWidth1pxSameBorder width
borderColor#D7DCE1#334155General border color
spacingUnit8pxSameBase spacing unit (margins, gaps)
buttonHeight40pxSameButton height
buttonPadding8px 16pxSameButton padding

Labels

VariableDefault (Light)Default (Dark)Description
labelColor#707689#e2e8f0Label text color
labelFontSize14.22pxSameLabel font size
labelFontWeight500SameLabel font weight

Panel & Container

VariableDefault (Light)Default (Dark)Description
panelBackground#FFFFFF#1e293bPanel background
panelBorderRadius8pxSamePanel corner radius
panelPadding24pxSamePanel internal padding
panelGap12pxSameGap between panel sections
panelShadow0 4px 12px rgba(0,0,0,0.1)SamePanel drop shadow

Payment Method Selector

VariableDefault (Light)Default (Dark)Description
paymentMethodBackground#fcfcfc#15202bCard background
paymentMethodBorder#d7dce1#475569Card border
paymentMethodBorderHover#0071ba#64748bCard border on hover
paymentMethodBorderRadius8pxSameCard corner radius
paymentMethodPadding16pxSameCard padding
paymentIconBackground#eeeeee#e2e8f0Payment icon background
paymentIconSize48pxSamePayment icon size
paymentIconRadius50pxSamePayment icon border radius
paymentTitleColor#25262d#f8fafcTitle color
paymentTitleFontSize18pxSameTitle font size

Effects & Additional

VariableDefault (Light)Default (Dark)Description
shadowFocus0 0 0 2px white, 0 0 0 5px #4A98E9SameFocus ring shadow
dividerColor#E0E0E0#cbd5e0Divider line color
infoTextColor#394046#cbd5e0Information text color
infoTextFontSize12.64pxSameInformation text font size
infoTextLineHeight18.96pxSameInformation text line height
noticeTextColor#6c757d#cbd5e0Notice text color (e.g. surcharge notice)
noticeTextFontSize14pxSameNotice text font size
noticeTextLineHeight1.4SameNotice text line height
linkColor#0074C7#4f96ffLink color

Amount Display

The ui.amountDisplay property controls how the payment amount is shown inside the Pay Now button:

ValueButton label example
"none"PAY NOW
"amount"PAY $30.00
"amountWithCurrencyCode"PAY $30.00 AUD (default)

Example Configuration

ui: {
theme: "light",
variables: {
colorPrimary: "#FF4500",
colorPrimaryHover: "#E13E00",
colorPrimaryActive: "#CC3700",
fontFamily: "system-ui, -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif",
panelBorderRadius: "12px",
paymentMethodBorderRadius: "12px"
},
amountDisplay: "none"
}