Skip to Content
Altruon.js reference

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 #ffffff

The background color of the component.

primaryColorstringdefault #4B5563

The color of primary interactive elements. In the annotated example below it colors the payment method header bar and the input borders.

secondaryColorstringdefault #9CA3AF

The color of secondary and supporting elements. In the annotated example below it colors the panel behind the form fields.

accentColorstringdefault #3B82F6

The accent color for focus states, active elements and highlights, such as the marker of the selected payment method.

borderRadiusstringdefault 8px

The corner radius of all elements, as a CSS length in pixels. For example 5px, 12px or 0px for square corners.

headerTextColorstringdefault #1F2937

The color of header text and titles.

fontFamilystringdefault system-ui, sans-serif

The font family for all text in the component, as a CSS font list. For example "Inter", system-ui, sans-serif.

textColorstringdefault #1F2937

The color of body text, labels and placeholders.

dropShadowbooleandefault true

Whether the component shows drop shadows.

The Altruon.js component showing a UPI form, with arrows naming the style property behind each part: backgroundColor around the component, primaryColor on the header bar and input borders, secondaryColor on the form panel, accentColor on the selected method marker, headerTextColor and fontFamily on the method title, textColor on labels and placeholders, borderRadius on the corners and dropShadow under the panel
Which property styles which part of the component

Color formats

Color properties accept these formats. Hex is recommended for consistency.

FormatExample
Hex#3B82F6
RGBrgb(229, 231, 235)
RGBA, with transparencyrgba(59, 130, 246, 0.8)
Named colorblack, 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.