Style options
Every property of the styleCustomization object, with its type, default and effect, the color formats it accepts and complete example themes.
styleCustomization is an optional object in the body of Create a session. It styles the Altruon.js component for that session. You set it on your server: there is no style configuration in the browser, and the styles apply to every payment method in the component.
It applies to Altruon.js only. Hosted pages and dynamic hosted checkout take their appearance from Settings > Checkout.
{
styleCustomization: {
backgroundColor: string;
primaryColor: string;
secondaryColor: string;
accentColor: string;
borderRadius: string;
headerTextColor: string;
fontFamily: string;
textColor: string;
dropShadow: boolean;
}
}For a walkthrough and recipes, see Style the component.
Properties
Every property is optional. A property you leave out uses its default.
backgroundColorstringdefault #ffffffThe background color of the component.
primaryColorstringdefault #4B5563The color of primary interactive elements. In the annotated example below it colors the payment method header bar and the input borders.
secondaryColorstringdefault #9CA3AFThe color of secondary and supporting elements. In the annotated example below it colors the panel behind the form fields.
accentColorstringdefault #3B82F6The accent color for focus states, active elements and highlights, such as the marker of the selected payment method.
borderRadiusstringdefault 8pxThe corner radius of all elements, as a CSS length in pixels. For example 5px, 12px or 0px for square corners.
headerTextColorstringdefault #1F2937The color of header text and titles.
fontFamilystringdefault system-ui, sans-serifThe font family for all text in the component, as a CSS font list. For example "Inter", system-ui, sans-serif.
textColorstringdefault #1F2937The color of body text, labels and placeholders.
dropShadowbooleandefault trueWhether the component shows drop shadows.

Color formats
Color properties accept these formats. Hex is recommended for consistency.
| Format | Example |
|---|---|
| Hex | #3B82F6 |
| RGB | rgb(229, 231, 235) |
| RGBA, with transparency | rgba(59, 130, 246, 0.8) |
| Named color | black, darkslategray |
Complete example
{
"styleCustomization": {
"backgroundColor": "#3a3a3a",
"primaryColor": "#4B5563",
"secondaryColor": "#3a3a3a",
"accentColor": "#5B7FFF",
"borderRadius": "5px",
"headerTextColor": "#ffffff",
"fontFamily": "Verdana, cursive",
"textColor": "#ffffff",
"dropShadow": false
}
}Example themes
Each theme is a complete styleCustomization object you can paste into the Create Session request.
For a dark mode interface.
styleCustomization: {
backgroundColor: '#1F2937',
primaryColor: '#3B82F6',
secondaryColor: '#374151',
accentColor: '#60A5FA',
borderRadius: '8px',
headerTextColor: '#F9FAFB',
fontFamily: 'Inter, system-ui, sans-serif',
textColor: '#E5E7EB',
dropShadow: true,
}Black on white with square corners and no shadow.
styleCustomization: {
backgroundColor: '#FFFFFF',
primaryColor: '#000000',
secondaryColor: '#E5E5E5',
accentColor: '#000000',
borderRadius: '0px',
headerTextColor: '#000000',
fontFamily: 'Arial, sans-serif',
textColor: '#333333',
dropShadow: false,
}A brand-led design with a strong color and large radius.
styleCustomization: {
backgroundColor: '#FFF5F7',
primaryColor: '#EC4899',
secondaryColor: '#FBE2EB',
accentColor: '#F472B6',
borderRadius: '16px',
headerTextColor: '#BE185D',
fontFamily: '"Poppins", sans-serif',
textColor: '#831843',
dropShadow: true,
}A restrained look for business software.
styleCustomization: {
backgroundColor: '#F8F9FA',
primaryColor: '#0056B3',
secondaryColor: '#6C757D',
accentColor: '#007BFF',
borderRadius: '4px',
headerTextColor: '#212529',
fontFamily: '"Roboto", sans-serif',
textColor: '#495057',
dropShadow: true,
}Built for accessibility, with high contrast between text and background.
styleCustomization: {
backgroundColor: '#FFFFFF',
primaryColor: '#D97706',
secondaryColor: '#92400E',
accentColor: '#F59E0B',
borderRadius: '12px',
headerTextColor: '#78350F',
fontFamily: 'system-ui, sans-serif',
textColor: '#1C1917',
dropShadow: true,
}styleCustomization: {
backgroundColor: '#FFFFFF',
primaryColor: '#10B981',
secondaryColor: '#D1FAE5',
accentColor: '#059669',
borderRadius: '8px',
headerTextColor: '#065F46',
fontFamily: '"Open Sans", sans-serif',
textColor: '#1F2937',
dropShadow: true,
}styleCustomization: {
backgroundColor: '#F8FAFC',
primaryColor: '#6366F1',
secondaryColor: '#C7D2FE',
accentColor: '#818CF8',
borderRadius: '10px',
headerTextColor: '#312E81',
fontFamily: '"Inter", sans-serif',
textColor: '#1E293B',
dropShadow: true,
}styleCustomization: {
backgroundColor: '#FFFFFF',
primaryColor: '#1E3A8A',
secondaryColor: '#BFDBFE',
accentColor: '#3B82F6',
borderRadius: '4px',
headerTextColor: '#1E40AF',
fontFamily: '"Roboto", sans-serif',
textColor: '#1F2937',
dropShadow: true,
}Three themes to choose from at runtime, one per plan. See Different styles per plan.
const themes = {
basic: {
backgroundColor: '#F9FAFB',
primaryColor: '#6B7280',
secondaryColor: '#D1D5DB',
accentColor: '#9CA3AF',
borderRadius: '4px',
headerTextColor: '#1F2937',
fontFamily: 'system-ui, sans-serif',
textColor: '#374151',
dropShadow: false,
},
premium: {
backgroundColor: '#FFFFFF',
primaryColor: '#3B82F6',
secondaryColor: '#BFDBFE',
accentColor: '#60A5FA',
borderRadius: '8px',
headerTextColor: '#1E40AF',
fontFamily: '"Inter", sans-serif',
textColor: '#1F2937',
dropShadow: true,
},
enterprise: {
backgroundColor: '#1F2937',
primaryColor: '#F59E0B',
secondaryColor: '#374151',
accentColor: '#FBBF24',
borderRadius: '12px',
headerTextColor: '#FCD34D',
fontFamily: '"Roboto", sans-serif',
textColor: '#F3F4F6',
dropShadow: true,
},
};