API Reference

Web SDK Customizations

A detailed list of all possible Web UI customizations

Setup

The Web SDK is built with web components and styles them using a styles file containing CSS custom properties and font face definitions. The Web SDK automatically loads the file each time it is triggered.

In order to display the UI correctly, you can follow these steps:

  1. Create the styles file following the guidance below

  2. Share the file with your implementation manager along with your logo in SVG format.

📘

To update the file at any point, contact your implementation manager.


Fonts

Font families

This tells the browser which font families to use, e.g. Arial, Roboto. Fonts must be already available to the page, either because they are mobile or imported by the rest of the page. The SDK doesn't import fonts. Fonts can be licensed under a specific domain. You are responsible for acquiring or managing licenses for all fonts you use.

🚧

Fonts must be publicly accessible (e.g., via Google Fonts ) or provided as a direct link to the font files. The link must allow CORS access on the domains where the Web SDK runs.

Custom properties:

PropertyDescription
--fl-font-familyThe body text font family.
Default: Roboto, system-ui, sans-serif
--fl-font-family-headerThe font to use for headings and titles.
Default: Roboto Slab, serif
--fl-font-family-monospaceA monospace font to use in client input fields.

Tip: Set this to ensure inputs don't change width as the client types in them due to characters having different widths.
Default: Roboto Mono, monospace

Example code:

fl-flow-verify, fl-flow-onboarding {
  --fl-font-family: 'Roboto', system-ui, sans-serif;
  --fl-font-family-header: 'Roboto Slab', serif;
  --fl-font-family-monospace: 'Roboto Mono', monospace;
}

Example screens:

Default font-family on the left, custom font-family on the right

Left: Default font family | Right: Custom

Font face rules

To tell the browser how to render fonts in different situations, you need to define the @font-face rules, e.g. style, weight, and the location of the font resource.

The URLs in the @font-face rules must be accessible by all relevant environments, e.g. sandbox, development, and production. You are responsible for handling any CORS exceptions to the files for these domains.

Fourthline's development domain is http://localhost:3333. To let us check how fonts render during implementation, add our domain to your exception list.

You can either define @font-face rules via:

  • A third-party font service, e.g. Google Fonts
  • Inlining

Third-party service

Before setting the font families, add an import statement with a URL to a font asset containing font-face definitions managed by a third-party service. The service maintains the font.

Example code:

@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500&family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;500&display=swap');

fl-flow-verify, fl-flow-onboarding {
  --fl-font-family: 'Roboto', system-ui, sans-serif;
  --fl-font-family-monospace: 'Roboto Mono', monospace;
  --fl-font-family-header: 'Roboto Slab', serif;
}

Inlining

After setting the font families, copy and paste the content of a third-party font asset into your SDK styles file. This reduces the number of requests in the critical path, but means the font is no longer maintained by the third party. You must host it, maintain it, and share the location URL with your implementation manager so it can be used from our domain.

Custom properties:

PropertyDescription
font-familyThe font family the font-face rule applies to.
font-styleThe font style, e.g. normal, italic.
font-weightThe size of the font.
srcThe local source in case a font of the same name is already available to the browser.

Example code:

  • Defines the My serif font, My sans-serif font, and My monospace font families
  • Sets a regular weight (400) and a semibold weight (600) for each family
  • Provides 2 different formats for each family to maximize browser compatibility and their locations
fl-flow-verify, fl-flow-onboarding {
--fl-font-family: 'Roboto', system-ui, sans-serif;
--fl-font-family-monospace: 'Roboto Mono', monospace;
--fl-font-family-header: 'Roboto Slab', serif;
}
@font-face {
  font-family: "My serif font";
  font-style: normal;
  font-weight: 400;
  src:
    local('My serif font'),
    url(".../my-serif-font-regular.woff2") format("woff2"),
    url(".../my-serif-font-regular.woff") format("woff");
}
@font-face {
  font-family: "My serif font";
  font-style: normal;
  font-weight: 600;
  src:
    local('My serif font'),
    url(".../my-serif-font-semibold.woff2") format("woff2"),
    url(".../my-serif-font-semibold.woff") format("woff");
}
@font-face {
  font-family: "My sans-serif font";
  font-style: normal;
  font-weight: 400;
  src:
    local('My sans-serif font'),
    url(".../my-sans-serif-font-regular.woff2") format("woff2"),
    url(".../my-sans-serif-font-regular.woff") format("woff");
}
@font-face {
  font-family: "My sans-serif font";
  font-style: normal;
  font-weight: 600;
  src:
    local('My sans-serif font'),
    url(".../my-sans-serif-font-semibold.woff2") format("woff2"),
    url(".../my-sans-serif-font-semibold.woff") format("woff");
}
@font-face {
  font-family: "My monospace font";
  font-style: normal;
  font-weight: 400;
  src:
    local('My monospace font'),
    url(".../my-monospace-font-regular.woff2") format("woff2"),
    url(".../my-monospace-font-regular.woff") format("woff");
}
@font-face {
  font-family: "My monospace font";
  font-style: normal;
  font-weight: 600;
  src:
    local('My monospace font'),
    url(".../my-monospace-font-semibold.woff2") format("woff2"),
    url(".../my-monospace-font-semibold.woff") format("woff");
}

Example screens:

Default font-size on the left, custom font-size on the right

Left: Default font size | Right: Custom size

Colors

You can define colors in any acceptable CSS way. For defined base colors, you can leave them or replace them with another shade of the same color.

Custom properties:

PropertyDescription
--fl-background-colorThe default background color.
Default: --fl-color-light
--fl-border-colorThe border color for buttons, hints, and QR components.
Default: rgba(0, 0, 0, 0.1)
--fl-color-primaryThe color alias used for illustrations and highlighted elements, e.g. buttons, inputs.
Notes:
• Illustrations and animations use the same primary color as the dominant color.
• Set to a base color or use a new color.
Default: var(--fl-color-info)
--fl-color-accentThe color alias used for choice elements, e.g. tabs, radio buttons.
Note: Set to a base color or use a new color.
Default: var(--fl-color-success)
--fl-color-dangerThe color for warnings about invalid client input.
Default: # E02020 red
--fl-color-darkThe default heading color.
Default: # 333333
--fl-color-dark-lightThe default text color.
Default: # 666666
--fl-color-dark-lighterThe default alternative and less emphasis text color.
Default: # 999999
--fl-color-hintThe color for hints.
Default: # FFF9D5 yellow
--fl-color-infoThe primary color for informative highlighting.
Default: # 0091FF blue
--fl-color-lightThe default background color.
Default: # FFFFFF
--fl-color-successThe color for successful events or actions.
Default: # 00E062 green
--fl-color-warningThe color for errors.
Default: # FA6400 orange
--fl-decorative-line-colorThe color of decorative lines.
Default: --fl-border-color
--fl-heading-colorThe color for headings.
Default: --fl-color-dark
--fl-hint-colorThe text color for hints.
Default: --fl-heading-color
--fl-hint-background-colorThe background color for hints.
Default: --fl-color-hint
--fl-illustration-colorThe illustration color.
Default: --fl-color-primary
--fl-illustration-background-colorThe illustration background color.
Default: rgba(0, 0, 0, 0.05);
--fl-illustration-success-colorThe illustration success color override.
Default: --fl-color-success
--fl-label-colorThe color for form field labels.
Default: --fl-color-gray
--fl-link-colorThe color for links.
Default: --fl-color-info
--fl-permission-background-colorThe color of the background screen for permissions requests.
Note: The background of illustrations is always a darker shade of the page background.
Default: --fl-color-primary
--fl-permission-colorThe text color for permissions requests.
Default: --fl-color-light
--fl-qr-borderThe color of the QR code border.
Default: --fl-color-info
--fl-strong-colorThe strong tag color.
Default: --fl-heading-color
--fl-tab-colorThe color for the redirect options tabs.
Default: --fl-heading-color
--fl-text-colorThe color for text.
Default: --fl-color-dark-light
--fl-text-light-colorThe color for text with less emphasis.
Default: --fl-color-dark-lighter
--fl-title-colorThe color for titles.
Default: --fl-heading-color
--fl-warning-face-colorThe skin color of the warning face on error screens.
Default: --fl-color-warning
--fl-warning-face-eyes-colorThe color of the eyes and mouth of the warning face on error screens.
Default: --fl-color-light

Example code:

{...}  
  --fl-color-primary: var(--my-primary-color);
  --fl-color-info: #0091FF;     /* blue */
  --fl-color-success: #00E062;  /* green */
  --fl-color-hint: #FFF9D5;     /* yellow */
  --fl-color-warning: #FA6400;  /* orange */
  --fl-color-danger: #E02020;   /* red */
  --fl-color-primary: var(--fl-color-info);
  --fl-color-accent: var(--fl-color-success);
  --fl-permission-background-color: green;

Example screens:

Default accent color on the left, custom accent color on the right

Illustration colors

Default permission background color on the left, custom color on the right

Input background colors

Themes

You can set light mode and dark mode themes for the UI, and are responsible for adding the theme class and hosting the styles.

Example code:

.dark-theme fl-flow-onboarding {
  /* Add your custom CSS variables for dark theme */
}

.light-theme fl-flow-onboarding {
  /* Add your custom CSS variables for light theme */
}

Layout

Border radiuses

The border radius sets how round or square corners of elements are.. You must set acceptable border radius values.

Custom properties:

PropertyDescription
--fl-button-border-radiusThe border radius for buttons.
--fl-hint-border-radiusThe border radius for user hints displayed to the client.
--fl-illustration-border-radiusThe border radius for illustrations.
--fl-input-border-radiusThe border radius for client input fields.
Default: 4px
--fl-main-border-radiusThe border radius for the whole screen.
--fl-qr-border-radiusThe border radius for the redirect QR code.
Default: 4px

Example code:

  --fl-main-border-radius: 4px;
  --fl-button-border-radius: 4px;
  --fl-illustration-border-radius: 4px;
  --fl-hint-border-radius: 4px;
  --fl-qr-border-radius: 4px;
  --fl-input-border-radius: 6px;

Example screens:

Default border-radius on the left, custom border-radius on the right

Left: Default border radius | Right: Custom

Buttons

  • Primary buttons use the --fl-color-primary as the background color with white text.
  • Secondary buttons use white as the background color and --fl-color-primary for text.
  • The disabled state sets how buttons and inputs appear when inactive or un-clickable.

Custom properties:

PropertyDescription
--fl-button-border-radiusThe border radius for buttons.
Default: 4px
--fl-button-disabled-colorThe button text color in disabled state.
Default: --fl-button-primary-color
--fl-button-disabled-background-colorThe button background color in disabled state.
Default: --fl-button-primary-background-color
--fl-button-disabled-border-colorThe button border color in disabled state.
Default: --fl-button-primary-border-color
--fl-button-disabled-opacityThe button opacity in disabled state.
Default: 0.5
--fl-button-primary-colorThe primary button text color.
Default: --fl-color-light
--fl-button-primary-background-colorThe primary button background color.
Default: --fl-color-primary
--fl-button-primary-border-colorThe primary button border color.
Default: --fl-border-color
--fl-button-secondary-colorThe secondary button text color.
Default: --fl-color-primary
--fl-button-secondary-background-colorThe secondary button background color.
Default: --fl-color-light
--fl-button-secondary-border-colorThe secondary button border color.
Default: --fl-border-color

Example code:

{...}
  --fl-button-disabled-color: var(--fl-color-primary);
  --fl-button-disabled-background-color: var(--fl-background-color);
  --fl-button-disabled-border-color: var(--fl-color-primary);
  --fl-button-disabled-opacity: 1;

Example screens:

Default styles on the left, custom ghosted of a disabled button on the right.

Left: Default button | Right: Ghost button

Illustrations

The introduction screen for each flow contains an illustration.

Custom properties:

PropertyDescription
--fl-illustration-colorThe illustration color.
Default: --fl-color-primary
--fl-illustration-background-colorThe illustration background color.
Default: rgba(0, 0, 0, 0.05);
--fl-illustration-success-colorThe illustration success color override.
Default: --fl-color-success
--fl-illustration-border-radiusThe border radius of the illustration.
Default: 4px

Example screens:

Magenta-based color scheme and adjusted accent color

Left: Default illustration | Right: Custom

Inputs

Inputs are fields where the client enters information, e.g. name, address, contact details.

Custom properties:

PropertyDescription
--fl-input-background-colorThe input background color.
Default: --fl-background-color
--fl-input-border-colorThe input border color.
Default: --fl-color-gray
--fl-input-border-radiusThe input border radius.
Default: 6px
--fl-input-colorThe input text color.
Default: --fl-heading-color
--fl-input-danger-colorThe text color for input danger hints.
Default: --fl-color-danger
--fl-input-disabled-background-colorThe background color for disabled inputs.
Default: # F2F2F2
--fl-input-focus-shadowThe box shadow for focal inputs.
Default: 0 0 4px 0 var(--fl-color-info)
--fl-input-font-weightThe font weight for the input text.
Default: --fl-font-weight-bold
--fl-input-info-colorThe text color for input information hints.
Default: --fl-color-info
--fl-input-placeholder-colorThe placeholder text color for inputs.
Default: --fl-text-light-color
--fl-input-selected-background-colorThe background color for inputs when selected.
Default: --fl-input-background-color
--fl-input-selected-colorThe color for inputs when selected.
Default: currentColor

Example code:

{...}
  --fl-input-selected-color: var(--fl-color-light);
  --fl-input-selected-background-color: var(--fl-color-dark);

Example screens:

Default styles on the left, custom background and color on the right.

Left: Default inputs | Right: Custom

Links

Links redirect the client to another screen.

Custom properties:

PropertyDescription
--fl-link-decorationThe text decoration for links.
Default: Underline
--fl-link-font-weightThe font weight for links.
Default: --fl-font-weight-regular
--fl-footer-link-colorThe color of the links in the footer.
Default: --fl-text-color

Logos

Fourthline's logo always appears in the footer of every screen.

You can add your logo in the top-right corner of the following screens:

  • Introduction screens, e.g. for the Document module, Selfie module, Signature module
  • Generic and system permission error screens
  • Success screens

Send your logo in .svg format to your implementation manager along with the styles file:

  • The maximum bounding box size is 120 x 50 px.
  • The logo is flexible, as long as it fits within the 120×50 px bounding box.
The logo is displayed on the top right corner

Fourthline logo

Padding

To set the padding of the main component, use the --fl-main-spacing property.

You must set an acceptable padding value.

Example code:

{...}
  --fl-main-spacing: 40px 80px 50px;