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
fontFamily'Ideal Sans', 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

Feedback & Validation

VariableDefault (Light)Default (Dark)Description
colorError#D32F2F#FF6B6BError text and icon color
colorSuccess#2E7D32#4CAF50Success/approved state color
inputBorderColorError#D32F2F#F87171Border color for invalid inputs
inputBorderColorFocuscolorPrimarycolorPrimaryBorder color when a field is focused

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
panelShadow0 4px 12px rgba(0,0,0,0.1)SamePanel drop shadow
headerBackground#003c66#0f172aHeader background
headerColor#242729#f8fafcHeader text color
headerFontSize18pxSameHeader font size
headerFontWeight600SameHeader font weight
headerPadding16pxSameHeader internal padding

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
paymentIconBackgroundtransparentSamePayment icon background
paymentTitleColor#25262d#f8fafcTitle color

Effects & Additional

VariableDefaultDescription
shadowFocus0 0 0 2px white, 0 0 0 5px #4A98E9Focus ring shadow
dividerColor#E0E0E0Divider line color
surchargeColor#6E7087Surcharge text color
securityTextColor#6E7087Security message text color
infoTextColor#6E7087Information text color
infoLinkColor#0074C7Link color

Example Configuration

ui: {
theme: "light",
variables: {
colorPrimary: "#FF4500",
colorPrimaryHover: "#E13E00",
colorPrimaryActive: "#CC3700",
colorError: "#D32F2F",
colorSuccess: "#2E7D32",
inputBorderColorFocus: "#FF4500",
fontFamily: "system-ui, -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif",
panelBorderRadius: "12px",
paymentMethodBorderRadius: "12px"
}
}