Skip to main content
Version: v2

Customization

It is not possible to move elements of the UI around, remove parts of the UI, or add new parts. To build your own screens, use the core library instead; read Platform SDK architecture.

The MicroblinkPlatform SDK comes with the ability to customize some aspects of the UI by using the UI theming. The screens can be customized to fit your app’s look and feel by setting properties of MicroblinkPlatformTheme.shared. Set them before you create the view with MicroblinkPlatform.view(configuration:onEvent:).

The properties take SwiftUI types: Color, Font, and Image.

General​

To change the default blue tint of buttons and other interactive elements, set the accent color:

MicroblinkPlatformTheme.shared.accentColor = your_color

Other general properties are:

  • accentColor: buttons and interactive elements. It's the same property as primaryColor.
  • backgroundColor: the background of the screens.
  • titleColor and subtitleColor: the title and subtitle of the main screen. They're the same properties as mainScreenTitleColor and mainScreenSubtitleColor.
  • errorColor: error messages.
  • buttonCornerRadius: the corner radius of buttons.

Images​

To change the image on the main screen, set the main screen image:

MicroblinkPlatformTheme.shared.mainScreenMainImage = Image("your_image")

You can also replace verifySuccessImage, verifyReviewImage, and verifyErrorImage on the result screens, and cameraPermissionIcon on the camera permission screen.

Fonts​

To change the font of the title on the main screen, set the main screen title font:

MicroblinkPlatformTheme.shared.mainScreenTitleFont = .custom("YourFont-Bold", size: 28)

Each screen has its own font properties, for example mainScreenSubtitleFont, mainButtonFont, errorFont, verifyTitleFont, and verifySubtitleFont. The document upload screens have documentUpload* color, font, and image properties.

Scanning screens​

The document scanning and card scanning screens have their own properties:

  • MicroblinkPlatformTheme.shared.documentScannerAppearance: colors and fonts of the alerts, the onboarding sheet, the reticle tooltip, and the help button on the document scanning screens. For example, documentScanOnboardingSheetTitleFont.
  • MicroblinkPlatformTheme.shared.cardScannerAppearance: similar properties for the card scanning screens. For example, onboardingSheetTitleFont.
  • MicroblinkPlatformTheme.shared.faceCaptureAppearance: the instructions, the success icon, the help button and its tooltip, the onboarding dialog, and the help sheet on the face capture screens. For example, helpTooltipBackground.
MicroblinkPlatformTheme.shared.documentScannerAppearance.documentScanAlertTitleColor = .red
MicroblinkPlatformTheme.shared.cardScannerAppearance.alertTitleColor = .red
MicroblinkPlatformTheme.shared.faceCaptureAppearance.helpTooltipBackground = .black

The face capture screens come from Microblink's face capture SDK. faceCaptureAppearance starts with that SDK's defaults, and the instruction colors stay fixed so that they remain readable over the camera image. accentColor doesn't change the colors of the scanning screens.

Customization 1 Customization 2 Customization 3 Customization 4 Customization 5