Skip to main content

Theming

ID Bolt allows comprehensive customization of its visual appearance to match your brand identity. Use the theme option when creating an ID Bolt session to customize colors, dimensions, and other visual elements.

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
theme: {
colors: {
primary: "#0070f3",
background: "#ffffff",
},
dimensions: {
radiusButton: "8px",
},
},
});

Color Customization

The colors object allows you to define colors for various UI elements:

PropertyTypeDescriptionSince
primarystringPrimary color used throughout the interface1.1
imagestringColor used for image-related elements1.1
backgroundstringMain popup background color1.1
backgroundSecondarystringSecondary background color for surfaces1.1
backgroundInversestringInverse background color1.1
backgroundScannerPlaceholderstringBackground color for scanner placeholder1.8
textPrimarystringPrimary text color1.1
textSecondarystringSecondary text color1.1
textTertiarystringTertiary text color1.1
textInversestringInverse text color1.1
textScannerPlaceholderstringText color for scanner placeholder1.8
successstringColor for success states1.1
errorstringColor for error states1.1
warningstringColor for warning states1.1
infostringColor for informational states1.1
buttonBackgroundstringBackground color for buttons1.1
buttonTextstringText color for buttons1.1
buttonBorderstringBorder color for buttons1.1
buttonBackgroundDisabledstringBackground color for disabled buttons1.1
buttonBorderDisabledstringBorder color for disabled buttons1.1
buttonTextDisabledstringText color for disabled buttons1.1
connectionStatusConnectingBackgroundstringBackground color for connection status pills in connecting/waiting state1.8
connectionStatusConnectingTextstringText color for connection status pills in connecting/waiting state1.8
connectionStatusSuccessBackgroundstringBackground color for connection status pills in success state1.8
connectionStatusSuccessTextstringText color for connection status pills in success state1.8
connectionStatusErrorBackgroundstringBackground color for connection status pills in error/failed state1.8
connectionStatusErrorTextstringText color for connection status pills in error/failed state1.8
headerButtonsstringColor for the header back and close buttons (when not in their white variant)1.8
dividerstringColor for divider lines, such as the one on the QR code page1.8

Dimension Customization

The dimensions object allows you to customize sizes and spacing:

PropertyTypeDescriptionSince
radiusPopupstringBorder radius for the popup1.1
radiusButtonstringBorder radius for buttons1.1
radiusCardstringBorder radius for cards1.1

All values are string and must be valid CSS dimension expressions. E.g. "12px".

Image Customization

Available since version 1.8.

The images object allows you to customize the images used in key screens:

const theme = {
images: {
welcome: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
flowCompleted: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...",
acceptedId: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA...",
},
};

Image Properties

PropertyTypeDescriptionSince
welcomestringImage displayed on the welcome screen, both on Desktop as well as hand-over1.8
flowCompletedstringImage displayed on the completion screen in hand-over flow1.8
acceptedIdstringImage displayed as a placeholder for an accepted image, when picture is not captured1.8

Image Requirements

  • Format: PNG, JPEG, SVG, or WebP (must be provided as data URLs with appropriate mime types)
  • Maximum size: 50KB per image (size of the base64 data URL)
  • Data URL format: Must start with one of the following prefixes:
    • data:image/png
    • data:image/jpeg
    • data:image/svg+xml
    • data:image/webp

Font Customization

Available since version 1.8.

The fonts object allows you to customize the fonts used in the interface:

const theme = {
fonts: {
primary: {
normal: "data:font/woff2;base64,d09GMgABAAAAAAT...",
semibold: "data:font/woff2;base64,d09GMgABAAAAAAU...",
bold: "data:font/woff2;base64,d09GMgABAAAAAAV...",
},
},
};

Font Properties

PropertyTypeDescriptionSince
primary.normalstringRegular font weight (400)1.8
primary.semiboldstringSemi-bold font weight (600)1.8
primary.boldstringBold font weight (700)1.8

Font Requirements

  • Format: WOFF2, WOFF, TTF, or OTF (must be provided as data URLs)
  • Maximum size: 100KB per font file (size of the base64 data url)
  • Data URL format: Must start with appropriate mime type prefixes (e.g., data:font/woff2, data:font/woff)

Style Overrides

Available since version 1.9.

The styleOverrides object allows you to apply custom CSS to specific UI elements:

const theme = {
styleOverrides: {
button: `
.bolt-button {
display: block;
width: 100%;
padding: 12px 24px;
background-color: #fcb700;
color: #000000;
text-align: center;
font-weight: bold;
font-size: 16px;
line-height: 1.5;
text-decoration: none;
border: none;
cursor: pointer;
box-sizing: border-box;
border-radius: 0;
box-shadow: none;
transition: background-color 0.2s ease-in-out;
}

.bolt-button:hover,
.bolt-button:focus {
background-color: #e0a800;
outline: none;
}
`,
link: `
.bolt-link {
text-decoration: none;
border-bottom: 1px dotted currentColor;
}
.bolt-link:hover {
border-bottom: 1px solid currentColor;
}
`,
title: `
.bolt-title {
text-transform: uppercase;
letter-spacing: 0.05em;
}
`,
},
};

Available Style Override Properties

PropertyTypeDescriptionSince
buttonstringCSS styles for buttons1.9
linkstringCSS styles for links1.9
titlestringCSS styles for titles1.9

CSS class names

Use the .bolt-button, .bolt-link and .bolt-title selectors for the styling rule. You can also create additional rules for pseudo-states like .bolt-button:hover etc. When a style override is specified, the element is rendered in its own shadow-DOM, with the provided style sheet attached.

The element will have many more CSS classes attached, but since it is rendered in a shadow DOM, these don't have an effect, unless you choose to use them in the style-override.

Shadow DOM

When a style override is specified, the component is rendered in a shadow DOM. This means that none of the default styles of ID Bolt apply to the component anymore. Therefore, make sure to specify all relevant styles.

Used HTML elements

Not all buttons use the <button> HTML element. Certain buttons in the UI are <a> links stylized as a button. Therefore, make sure to also add display: flex or display: block, as well as rules such as text-decoration to your style sheet.

tip

Always make sure to thoroughly test the full ID Bolt flow when you customize the styles, to make sure the result is as expected on all screens.

Available since version 1.9.

You can apply additional styling to the ID Bolt popup container directly from your application's CSS. This is particularly useful for customizing the popup's outer appearance like adding a box shadow:

/* In your application's CSS */
idbolt-pop-up::part(container) {
box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.2);
}

Note that this approach only affects the popup container itself and not elements inside the popup. For customizing the internal elements, use the Theme API described above.