SDK reference, Incode Web SDK 2 Reference / Customization 2

Theming & Styling

Warning

This guide is specific to Web SDK 2.x. For Web SDK 1.x, you can find documentation here.

Do not attempt to upgrade or implement without support. Contact your Incode representative to check if you are a candidate for this upgrade.

The Incode Web SDK uses CSS custom properties (variables) for theming, making it easy to match your brand.

To replace a built-in branded illustration or animation (tutorial graphics, success/fail screens) instead of recoloring it, see Asset Overrides.

Quick Start

Import the base tokens and override the variables you want to customize:

/* Import the SDK theme (defines all CSS variables you can override) */
@import '@incodetech/web/themes/light.css';

/* Override with your brand color — easiest path */
:root {
  --primitive-color-brand-500: #0066cc;
  --primitive-color-brand-400: #1f7fdf; /* slightly lighter, used on hover */
  --primitive-color-brand-600: #0052a3; /* slightly darker, used on press */
}

Note: The SDK ships two themes: @incodetech/web/themes/light.css and @incodetech/web/themes/dark.css. Pick one as your base, then override variables to match your brand. Component layout/structure CSS lives separately in @incodetech/web/base.css and per-module CSS such as @incodetech/web/flow/styles.css. The full token catalog is documented below.

Token Hierarchy

The SDK uses a layered token system:

Primitives → Semantic → Component-specific

Each layer references the layer above. Most overrides target the primitive or component layer; touching the semantic layer cascades broadly so use it intentionally.

1. Primitive Tokens

Concrete values that nothing else customizes:

:root {
  /* Color scales (50, 100, 200, ..., 900, 1000) for: gray, brand, brand-secondary, positive, warning, negative */
  --primitive-color-gray-0: #ffffff;
  --primitive-color-gray-500: #6b7280;
  --primitive-color-gray-900: #1f2937;
  --primitive-color-brand-500: #0066cc;

  /* Spacing scale (--primitive-scale-*) and the friendly --spacing-* aliases */
  --primitive-scale-4: 4px;
  --spacing-4: var(--primitive-scale-4);
  --spacing-16: var(--primitive-scale-16);

  /* Typography */
  --primitive-typography-family-rethink-sans: 'Rethink Sans';
  --primitive-typography-size-16: 16px;
  --primitive-typography-weight-regular: 400;
  --primitive-typography-weight-medium: 500;

  /* Border radius scale (--primitive-border-radius-0/4/8/16/24/40/64/9999) and aliases */
  --border-radius-medium: var(--primitive-border-radius-16);
  --border-radius-full: var(--primitive-border-radius-9999);
}

2. Semantic Tokens

Purpose-based names that reference primitives. Different values resolve in @incodetech/web/themes/light.css vs. dark.css, so overriding a semantic token affects whichever theme you're on:

:root {
  /* Surfaces — backgrounds */
  --surface-neutral-0: var(--primitive-color-gray-0); /* base background */
  --surface-neutral-50: var(
    --primitive-color-gray-50
  ); /* subtle elevated surface */
  --surface-neutral-900: var(--primitive-color-gray-900); /* highest contrast */
  --surface-brand-500: var(--primitive-color-brand-500); /* brand fill */
  --surface-status-negative-500: var(--primitive-color-negative-500);
  --surface-status-warning-500: var(--primitive-color-warning-500);
  --surface-status-positive-500: var(--primitive-color-positive-500);

  /* Text — foreground colors */
  --text-body-800-primary: var(
    --primitive-color-gray-800
  ); /* primary body text */
  --text-body-500-secondary: var(
    --primitive-color-gray-500
  ); /* secondary / muted */
  --text-body-400: var(--primitive-color-gray-400); /* placeholders, disabled */
  --text-link-default: var(--primitive-color-brand-500);
  --text-link-hover: var(--primitive-color-brand-300);
  --text-accent-brand: var(--primitive-color-brand-500);

  /* Borders */
  --border-neutral-100: var(--primitive-color-gray-100);
  --border-neutral-400: var(--primitive-color-gray-400);
  --border-status-negative: var(--primitive-color-negative-500);
  --border-status-focus: var(--primitive-color-brand-500);
}

Many tokens have a -static variant that stays fixed across light/dark themes (used for elements that should look identical regardless of theme, like a brand-coloured button). For example --surface-brand-500-static does not switch in dark mode the way --surface-brand-500 might.

3. Component Tokens

Specific to individual components. These reference semantic tokens, so overriding a component token gives you targeted control without affecting other components:

:root {
  /* Primary button */
  --button-primary-surface-default: var(--surface-brand-500-static);
  --button-primary-surface-hover: var(
    --surface-brand-400-static
  ); /* lighter on hover */
  --button-primary-surface-pressed: var(
    --surface-brand-600-static
  ); /* darker on press */
  --button-primary-surface-disabled: var(--surface-neutral-100);
  --button-primary-text-default: var(--text-body-0-static);
  --button-primary-border-radius: var(--border-radius-medium);

  /* Inputs */
  --input-surface-default: var(--surface-neutral-50);
  --input-surface-disabled: var(--surface-neutral-100);
  --input-border-default: var(--border-neutral-400);
  --input-border-focused: var(--border-status-focus);
  --input-border-negative: var(--border-status-negative);
  --input-text-field-default: var(--text-body-800-primary);
  --input-text-field-placeholder: var(--text-body-400);

  /* Spinner */
  --spinner-surface-primary: var(--surface-brand-500-static);
  --spinner-surface-secondary: var(--surface-brand-50);
  --spinner-text-title: var(--text-body-800-primary);
  --spinner-text-subtitle: var(--text-body-500-secondary);
}

button-* tokens come in primary, secondary, and tertiary variants, each with surface, text, and border properties across default / hover / pressed / disabled states.

Common Customizations

Brand colors

The simplest path is to override the primitive brand scale. Everything semantic (--surface-brand-*, --text-accent-brand, button colors, focus rings, etc.) inherits automatically:

:root {
  --primitive-color-brand-50: #e6f0ff;
  --primitive-color-brand-100: #cce0ff;
  --primitive-color-brand-300: #4d9aff;
  --primitive-color-brand-400: #1f7fdf; /* button hover */
  --primitive-color-brand-500: #0066cc; /* main brand */
  --primitive-color-brand-600: #0052a3; /* button pressed */
}

The default Incode logo in the header uses the brand color too (--icon-brand-500-static). To show a logo in fixed colors, set your own with logoSrc.

If you need finer control, override the component tokens directly:

:root {
  --button-primary-surface-default: #0066cc;
  --button-primary-surface-hover: #1f7fdf;
  --button-primary-surface-pressed: #0052a3;
}

Dark mode

The SDK already ships a dark theme. Import it instead of rolling your own:

@import '@incodetech/web/themes/dark.css';

If you want to switch themes per user preference, gate the import or apply it conditionally:

/* Default to light, switch to dark when the user prefers dark */
@import '@incodetech/web/themes/light.css';

@media (prefers-color-scheme: dark) {
  @import '@incodetech/web/themes/dark.css';
}

Typography

The SDK uses Rethink Sans by default. Override the primitive family if you want a different font everywhere:

:root {
  --primitive-typography-family-rethink-sans:
    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

The default font tokens fall back to system fonts while the web font loads: --primitive-typography-family-rethink-sans is "Rethink Sans", system-ui, sans-serif and --primitive-typography-family-dm-sans is "DM Sans", system-ui, sans-serif. When you override a family token, include your own fallback in the value, as in the example above.

The paragraph-spacing tokens (--primitive-typography-paragraph-spacing-* and --typography-*-paragraph-spacing) were removed. No SDK style read them, so overriding them had no effect.

Sizes (--primitive-typography-size-12 through --primitive-typography-size-80) and weights (--primitive-typography-weight-regular, --primitive-typography-weight-medium, --primitive-typography-weight-semibold, --primitive-typography-weight-bold) are also override-able primitive tokens.

Prizma tokens

@incodetech/web/themes/light.css and dark.css also define a set of --prizma-* tokens. Where the SDK has a matching token, the --prizma-* token reads it, so your overrides, the Dashboard theme, an Incode Studio export, and dark mode apply to the design-system components the SDK adopts over time. You don't need to set --prizma-* tokens yourself, and no SDK token was renamed.

Border radius

The radius scale is --border-radius-{none,x-small,small,medium,large,x-large,xx-large,full}. Components reference these via component tokens:

:root {
  /* Round all primary buttons more aggressively */
  --button-primary-border-radius: var(--border-radius-large);

  /* Or change the underlying scale */
  --primitive-border-radius-16: 12px; /* shrinks --border-radius-medium */
}

Since 2.5.0, the buttonBorderRadius of your Dashboard theme and the corner radius of an Incode Studio theme also set the button radius, so buttons change corners on upgrade if your theme defines one. buttonBorderRadius needs a CSS length with a unit, such as "30px" or "1.5rem". A bare number is read as pixels, and an invalid value is ignored. Your own --incode-button-primary-radius and --incode-button-secondary-radius CSS still wins over the Dashboard theme.

Container Styling

The SDK elements fill their container. Style the parent for layout control:

<!-- Full viewport height -->
<div style="height: 100vh;">
  <incode-flow></incode-flow>
</div>

<!-- Fixed height modal -->
<div style="height: 600px; width: 400px;">
  <incode-flow></incode-flow>
</div>

Direct CSS Overrides

CSS variables cover color, typography, spacing, and border radius. Some properties — text alignment, for example — have no dedicated token, because most integrations never need to change them. For those, override the component's CSS class directly.

The SDK's web components render without Shadow DOM: every custom element registers with shadow: false, so your page's CSS cascades into components exactly as it cascades into any other element on the page. There's no encapsulation boundary to work around.

Every component also renders plain, Incode-prefixed CSS classes on its root and key child elements — for example .IncodeButton, .IncodeInput, .IncodeFlowCompletedTitle. These class names are stable across releases, so your stylesheet can target them directly.

Matching selector specificity

Some classes are flat and override with a single selector:

.IncodeFlowStartSubtitle {
  text-align: right;
}

Others are nested under an ancestor, or qualified with a tag name, for extra specificity. Match or exceed that specificity in your override, or fall back to !important:

/* Overrides .IncodeComponent .IncodeFlowCompleted h1.IncodeFlowCompletedTitle */
.IncodeComponent .IncodeFlowCompleted h1.IncodeFlowCompletedTitle,
.IncodeComponent .IncodeFlowCompleted p.IncodeFlowCompletedSubtitle {
  text-align: right;
}

Info

Some styles switch at a breakpoint. IncodeFlowCompletedTitle left-aligns by default and centers above 992px width, for example. Override the base rule and any matching @media rule together, so your alignment holds at every screen size.

Common classes to target

This is a starting point, not a full inventory — inspect the rendered element in your browser's devtools for anything not listed here.

Component Root class Notable child classes
Button .IncodeButton .IncodeButtonPrimary / Secondary / Link, .IncodeButtonL / M / S, .IncodeButtonLoading
Input .IncodeInput State reflected via [aria-invalid], :disabled, [type='date']
Typography .IncodeTypographyH1–H5, .IncodeTypographyP Nested under .IncodeComponent
Screen header logo .IncodePageLogo .IncodePageLogoCustom, .IncodePageLogoSquarish, .IncodePageLogoVector (see Logo sizing)
Flow start screen .IncodeFlowStart .IncodeFlowStartSubtitle, .IncodeFlowStartLogo
Flow completed screen .IncodeFlowCompleted .IncodeFlowCompletedTitle, .IncodeFlowCompletedSubtitle
Spinner .IncodeSpinner See Spinner Customization below

Global UI Config

CSS variables and class overrides change how components look. setUiConfig changes what they show, for branding elements that aren't worth a CSS override — the logo, the subtitle text, and whether the default header or footer renders at all.

Call it directly, or pass the same shape to setup({ uiConfig }):

import { setUiConfig } from '@incodetech/web';

setUiConfig({
  logoSrc: 'https://your-cdn.com/logo.svg',
  subtitle: 'Verify your identity to continue',
  hideHeader: false,
  hideFooterBranding: true,
});
Option Type Description
logoSrc string Replaces the default Incode logo. The SDK sizes it by its shape; see Logo sizing.
logoDarkSrc string Logo used while the dark theme is active (data-incode-theme="dark"). Falls back to logoSrc when unset.
logoHeight string Deprecated. Has no effect: the SDK sizes the logo itself (see Logo sizing).
subtitle string Replaces the default subtitle text under the logo.
hideHeader boolean Hides the default header entirely.
hideFooterBranding boolean Hides the default "Verified by Incode" footer branding.
helpButtonPosition 'bottomRight' | 'topRight' | 'topLeft' Moves the capture help button (the "?" that opens the common-issues modal) on the ID and document capture screens. Defaults to 'bottomRight', inside the capture footer; the top* values float it beside the header.
closeButtonPosition 'topRight' | 'topLeft' Corner for the close button. Defaults to 'topRight'. It only has an effect when the Flow, Workflow, or module sets config.allowUserToCancel: true (see below). Can't match helpButtonPosition — on a collision, the help button falls back to its own default and a dev warning is logged. The "No internet connection" screen never shows the X: it always shows its own Close button, which stops the module and calls onError(undefined, undefined, 'NO_INTERNET_CONNECTION') once.
realtimeFeedbackMessageUIFlavor 'standard' | 'minimal' How the ID capture realtime feedback message renders (live cues: not aligned, too blurry, glare, show front, show back). Defaults to 'standard' — copy with the animation beside it. 'minimal' drops the animation and centers the copy, which reads better on small screens. The cues, copy, and screen-reader announcements are the same either way.
disableUnsupportedBrowserScreen boolean true hides the browser-not-supported screen in standalone modules. false shows it, even if the session's flow hides it. When you omit it, each module uses the setting of the session's flow. A per-element config.disableUnsupportedBrowserScreen overrides this value. <incode-flow> and <incode-workflow> ignore it and always use the server setting. See Browser support.

All options are optional — pass only the ones you want to change.

Logo sizing

The SDK sizes your logo by its shape, so wide and square logos look balanced in the header of every screen, including the redirect-to-mobile QR and waiting screens. The default Incode logo keeps its own size.

Logo shape Phone Larger screens (768px and up)
Wide (1.5:1 or wider) Fits a 180×36px box Fits a 180×36px box
Squarish (narrower than 1.5:1), such as a mark or badge 44px tall 64px tall, in a 72px header
  • SVG logos always fill their box. The SDK recognizes an SVG by a URL ending in .svg or a data:image/svg+xml URL. Give the SVG width and height attributes so the SDK can read its shape.
  • PNG and JPG logos shrink to fit but are never enlarged past their own size, so a small file renders smaller than the box instead of blurry. For a sharp logo on high-density screens, export at least 360×72px (wide) or 128×128px (squarish), or use an SVG.
  • Trim transparent padding from the file. The SDK sizes the whole image, so a logo with a wide transparent border looks small.

Let the user cancel

Whether the user may quit is a behavior of the flow, not a theme option, so you set it on the element's config, not in uiConfig:

flow.config = { ...flowConfig, allowUserToCancel: true };

setUiConfig({ closeButtonPosition: 'topLeft' }); // optional, defaults to 'topRight'

allowUserToCancel is off by default and works on <incode-flow>, <incode-workflow>, and standalone modules. When it is true, the SDK shows an "X" close button. After the user confirms, the SDK stops the module and calls onError(undefined, undefined, 'USER_CANCELLED') once; remove the element in that callback. For a Flow or Workflow, the whole flow quits. The button is not shown on screens that hide the header. closeButtonPosition only chooses the corner and does nothing while allowUserToCancel is off.

Your config versus the Dashboard theme

<incode-flow> and <incode-workflow> fetch your Dashboard's theme when they initialize. If you have published a theme in Incode Studio, that is the theme they fetch (see When your Dashboard has a Studio theme). Otherwise they fetch the dashboard brand color. Your own config and that theme are separate tiers, composed per field on read:

  1. What you set via setup({ uiConfig }) or setUiConfig — wins.
  2. The dashboard theme — fills the fields you left unset.
  3. Built-in defaults.

Consequences worth knowing:

  • The theme contributes only logoSrc, logoDarkSrc, subtitle, and hideFooterBranding. It cannot touch assets, animations, spinner, hideHeader, or logoHeight, so a theme arriving mid-flow never disturbs those.
  • A field you leave undefined counts as unspecified, so the theme still supplies it. Set a field explicitly to keep the dashboard out of it.
  • The theme's colors and button radius only fill gaps too. They are applied with zero specificity, so values from an imported Incode Studio export win over them, whatever the load order.

Set disableDashboardTheme: true in the Flow or Workflow config (see IncodeFlow Component) to skip the theme fetch altogether. You no longer need it to protect your own values — set the fields you care about and they hold.

setUiConfig still replaces your tier rather than merging into it, so pass every field you want to keep on each call.

Apply an Incode Studio export

Incode Studio exports a web theme as a zip with three parts:

File Carries
incode-theme.css Colors and button corner radius, as --incode-* variables
CustomizationOptionsV2.json Light or dark mode (theme.displayMode) and UX options (ux)
assets/ The logo (and optionally a dark-theme logo)

Import the CSS and pass the JSON and the logos to applyStudioConfig:

import './incode-theme.css';
import { applyStudioConfig } from '@incodetech/web';
import studioConfig from './CustomizationOptionsV2.json';
import logo from './assets/logo-light.svg';
import logoDark from './assets/logo-dark.svg';

applyStudioConfig(studioConfig, { logoSrc: logo, logoDarkSrc: logoDark });

Rules:

  1. Call applyStudioConfig before the flow element is created. It accepts the parsed JSON or a JSON string.
  2. It merges into your config. If you also call setUiConfig, call it before applyStudioConfig, because setUiConfig replaces the whole config and would drop the Studio settings.
  3. If the export has displayMode: "dark", import @incodetech/web/themes/dark.css as well. The call sets data-incode-theme="dark" on the document.
  4. Every part is optional. Without the CSS, the SDK colors stay; without the JSON, only the logo applies.
  5. The Studio CSS wins over the Dashboard theme the flow fetches. You don't need disableDashboardTheme.

Applied from the JSON: displayMode, showFooter, helpButtonPosition, closeButtonPosition, realtimeFeedbackMessageUIFlavor. The close button itself is not part of the export: set allowUserToCancel in code (see Let the user cancel). Keys the SDK doesn't support yet are ignored. A supported key with an invalid value logs a warning in development and the SDK default applies. A structurally invalid JSON throws.

Not applied yet (no SDK token): secondary button background, primary and secondary button text hover/pressed, and the neutral background palette.

When your Dashboard has a Studio theme

Once you publish a theme in Incode Studio, <incode-flow> and <incode-workflow> fetch it and apply it. You don't need to write any code for this. Until you publish, they keep using the Dashboard brand color. It takes the place of the Dashboard brand color and follows the same tier rules (see Your config versus the Dashboard theme).

The fetched Studio theme applies:

  • The color palette: brand, gray, positive, warning, and negative.
  • The corner radius of the primary and secondary buttons.
  • The logo and the dark-theme logo.
  • Whether the "Verified by Incode" footer shows (showVerifiedTag: false hides it, like hideFooterBranding: true). Your own hideFooterBranding wins.

It does not apply the display mode, fonts, or other settings. To show the dark theme, set it yourself (see Dark mode), or import an export with applyStudioConfig.

You can also import a Studio export (above) in the same app. Your export wins, part by part:

Part Your imported export (incode-theme.css, applyStudioConfig) Fetched Studio theme
Colors and button radius Wins for every variable your CSS sets Fills in the variables your CSS does not set
Logo, dark-theme logo, and footer branding Wins for every value you pass Fills in the values you leave out

To use only your export, set disableDashboardTheme: true in the flow or workflow config. The SDK then skips the fetch.

Spinner Customization

This follows the same override pattern described in Direct CSS Overrides above. The loading spinner displayed during flow initialization, module loading, and transitions exposes four tokens:

:root {
  /* Spinner icon colors */
  --spinner-surface-primary: #0066cc; /* foreground arc */
  --spinner-surface-secondary: #e6f0ff; /* track */

  /* Spinner text */
  --spinner-text-title: #1a1a1a;
  --spinner-text-subtitle: #666666;
}

The full-screen overlay background uses --surface-neutral-0 from the active theme — override that primitive (or the corresponding --primitive-color-gray-0) if you want a different overlay color, rather than reaching for a dedicated token (there isn't one).

Loader presentation

Set spinner to control what every SDK loader renders — including the ones inside modules, such as the ID module's camera-prep screen and the camera-permission screen, which a flow-level spinnerConfig never reached.

import { setup } from '@incodetech/web';

await setup({
  apiURL: API_URL,
  token: session.token,
  uiConfig: {
    spinner: { renderMode: 'textOnly', size: 'large' },
  },
});
Option Type Description
renderMode 'spinnerAndText' | 'spinnerOnly' | 'textOnly' Which parts of the loader render.
size 'small' | 'medium' | 'large' Icon size — 24px / 48px / 64px. Defaults to the design-system loader size (48px).

renderMode: 'textOnly' drops the spinning icon and keeps the copy, for when you want to animate the text yourself. The container gains an IncodeSpinnerTextOnly class to target.

Set the same shape on a single element's config to override the global value for that element only:

idElement.config = { ...idConfig, spinner: { renderMode: 'spinnerOnly' } };

Precedence is per-instance config → global setup({ uiConfig }) → built-in default, matching Asset Overrides.

Changing loader text? That comes from i18n, not from spinner. Override the loadingCircle.holdOn, loadingCircle.validating, and loadingCircle.preparingCamera keys — see Internationalization. Keeping copy in translations is what lets it follow a runtime language change.

CSS Class Targeting

You can also target spinner classes directly:

/* Main spinner container */
.IncodeSpinner {
  /* your styles */
}

/* Full-screen spinner overlay */
.IncodeSpinnerFullScreen {
  /* your styles */
}

/* Spinner content wrapper */
.IncodeSpinnerContent {
  /* your styles */
}

/* Wrapper around title + subtitle */
.IncodeSpinnerText {
  /* your styles */
}

/* Title and subtitle text */
.IncodeSpinnerTitle {
  /* your styles */
}

.IncodeSpinnerSubtitle {
  /* your styles */
}

Key CSS Variables

A high-level cheat sheet of the categories you'll most often override. The full inventory ships in @incodetech/web/themes/light.css and @incodetech/web/themes/dark.css — inspect them in your browser's devtools or your bundler's source view to see every variable.

Category Examples
Brand --primitive-color-brand-{50..600} (override these to re-skin everything)
Surfaces --surface-neutral-{0..1000}, --surface-brand-{50,100,500,500-static,600-static}, --surface-status-{negative,warning,positive}-{50,500}
Text --text-body-{0,400,500-secondary,800-primary}, --text-link-{default,hover,visited,disabled}, --text-accent-brand, --text-status-{negative,warning,positive}
Borders --border-neutral-{100,400}, --border-status-{negative,warning,positive,focus}
Buttons --button-{primary,secondary,tertiary}-{surface,text,border}-{default,hover,pressed,disabled}, --button-*-border-radius
Inputs --input-{surface,border,icon,text-field,text-helper,text-label}-{default,focused,disabled,negative}
Spinner --spinner-surface-{primary,secondary}, --spinner-text-{title,subtitle}
Layout --spacing-{2..96}, --border-radius-{none,x-small,small,medium,large,x-large,xx-large,full}
Type --primitive-typography-family-*, --primitive-typography-size-{12..80}, --primitive-typography-weight-{regular,medium,semibold,bold}

Was this page helpful?