Theme API for iOS
Use theme API to fully customize all visual aspects of the iOS SDK.
Theme options are named to express their semantic and used in many different places across the iOS SDK, so be aware that changing them may affect many elements at once.
For convenience, the options are split into the corresponding sections:
Fonts
headline1
theme.fonts.headline1: UIFontUsed for screen titles in conjunction with colors.contentStrong mostly.
Default is System Bold, 24pt.
headline2
theme.fonts.headline2: UIFontUsed for section titles in conjunction with colors.contentStrong mostly.
Default is System Bold, 20pt.
subtitle1
theme.fonts.subtitle1: UIFontUsed for subtitles in conjunction with colors.contentStrong mostly.
Default is System Semibold, 18pt.
subtitle2
theme.fonts.subtitle2: UIFontUsed for subtitles in conjunction with colors.contentNeutral mostly.
Default is System Regular, 16pt.
body
theme.fonts.body: UIFontUsed for paragraphs, text fields, and so on, in conjunction with colors.contentNeutral mostly.
Default is System Regular, 14pt.
caption
theme.fonts.caption: UIFontUsed for minor captions in conjunction with colors.contentWeak mostly.
Default is System Regular, 12pt.
Colors
Common
navigationBarItem
theme.colors.navigationBarItem: UIColorNavigation bar items tinting color. Used for the close button only at the moment.
Default is ● #94A0B8 and ● #FFFFFF with alpha 40% for the dark appearance.
alertTint
theme.colors.alertTint: UIColorUsed for the system alert actions and the toolbar buttons.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
toolbarTint
theme.colors.toolbarTint: UIColorUsed for the toolbars' buttons.
Default is ● #5C6B8A and ● #FFFFFF with alpha 60% for the dark appearance.
toolbarBackground
theme.colors.toolbarBackground: UIColor?Used as a background color for the toolbars.
Default is nil, the system background color is applied.
Backgrounds
backgroundCommon
theme.colors.backgroundCommon: UIColorUsed for almost all the screens as the background color (the exception is the Camera Screen, see cameraBackground).
Default is ● #FFFFFF and ● #1E232E for the dark appearance.
backgroundNeutral
theme.colors.backgroundNeutral: UIColorUsed as a background state color for the verification steps and as a main background color for the .filled-style cards.
Default is ● #F6F7F9 and ● #FFFFFF with alpha 7% for the dark appearance.
backgroundInfo
theme.colors.backgroundInfo: UIColorNot used at the moment.
Default is ● #E8F4FD and ● #072F4B for the dark appearance.
backgroundSuccess
theme.colors.backgroundSuccess: UIColorUsed as a background state color for the verification steps and as a background color for the auto-generated images.pictureSuccess.
Default is ● #18B494 with alpha 12% and ● #18B494 with alpha 30% for the dark appearance.
backgroundWarning
theme.colors.backgroundWarning: UIColorUsed as a background state color for the verification steps and as a background color for the auto-generated images.pictureWarning and images.pictureSubmitted.
Default is ● #F2AA0D with alpha 13% and ● #F2AA0D with alpha 30% for the dark appearance.
backgroundCritical
theme.colors.backgroundCritical: UIColorUsed as a background state color for the verification steps and as a background color for the auto-generated images.pictureFailure.
Default is ● #F05C5C with alpha 12% and ● #F05C5C with alpha 30% for the dark appearance.
Content
contentLink
theme.colors.contentLink: UIColorUsed for the text links.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
contentStrong
theme.colors.contentStrong: UIColorUsed as a foreground color for the headlines and some subtitles.
Default is ● #333C4D and ● #FFFFFF with alpha 85% for the dark appearance.
contentNeutral
theme.colors.contentNeutral: UIColorUsed as a foreground color for the text body, some subtitles and the accessory elements.
Default is ● #5C6B8A and ● #FFFFFF with alpha 60% for the dark appearance.
contentWeak
theme.colors.contentWeak: UIColorUsed as a foreground color for the minor captions and the light accessory elements.
Default is ● #94A0B8 and ● #FFFFFF with alpha 40% for the dark appearance.
contentInfo
theme.colors.contentInfo: UIColorUsed for the Video Screen's viewport border only at the moment.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
contentSuccess
theme.colors.contentSuccess: UIColorUsed as a foreground state color for the verification steps and as a foreground color for the auto-generated images.pictureSuccess.
Default is ● #18B494.
contentWarning
theme.colors.contentWarning: UIColorUsed as a foreground state color for the verification steps and as a foreground color for the auto-generated images.pictureWarning and images.pictureSubmitted.
Default is ● #E6A00B.
contentCritical
theme.colors.contentCritical: UIColorUsed as a foreground state color for the verification steps and as a foreground color for the auto-generated images.pictureFailure.
Default is ● #F05C5C.
Primary Button
primaryButtonBackground
theme.colors.primaryButtonBackground: UIColorThe primary button background color in the normal state.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
primaryButtonBackgroundHighlighted
theme.colors.primaryButtonBackgroundHighlighted: UIColorThe primary button background color in the highlighted state.
Default is ● #1485D1 and ● #0B4A75 for the dark appearance.
primaryButtonBackgroundDisabled
theme.colors.primaryButtonBackgroundDisabled: UIColorThe primary button background color in the disabled state.
Default is ● #A1D2F7 and ● #072F4B for the dark appearance.
primaryButtonContent
theme.colors.primaryButtonContent: UIColorThe primary button foreground color in the normal state.
Default is ● #FFFFFF and ● #FFFFFF with alpha 85% for the dark appearance.
primaryButtonContentHighlighted
theme.colors.primaryButtonContentHighlighted: UIColorThe primary button foreground color in the highlighted state.
Default is ● #FFFFFF and ● #FFFFFF with alpha 85% for the dark appearance.
primaryButtonContentDisabled
theme.colors.primaryButtonContentDisabled: UIColorThe primary button foreground color in the disabled state.
Default is ● #FFFFFF and ● #0B4A75 for the dark appearance.
Secondary Button
secondaryButtonBackground
theme.colors.secondaryButtonBackground: UIColorThe secondary button background color in the normal state.
Default is the clear color.
secondaryButtonBackgroundHighlighted
theme.colors.secondaryButtonBackgroundHighlighted: UIColorThe secondary button background color in the highlighted state.
Default is ● #E8F4FD and ● #072F4B for the dark appearance.
secondaryButtonBackgroundDisabled
theme.colors.secondaryButtonBackgroundDisabled: UIColorThe secondary button background color in the disabled state.
Default is the clear color.
secondaryButtonContent
theme.colors.secondaryButtonContent: UIColorThe secondary button foreground color in the normal state.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
secondaryButtonContentHighlighted
theme.colors.secondaryButtonContentHighlighted: UIColorThe secondary button foreground color in the highlighted state.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
secondaryButtonContentDisabled
theme.colors.secondaryButtonContentDisabled: UIColorThe secondary button foreground color in the disabled state.
Default is ● #A1D2F7 and ● #0B4A75 for the dark appearance.
Card
cardPlainBackground
theme.colors.cardPlainBackground: UIColorUsed as a background color for the cards with .plain card style.
Default is nil.
cardBorderedBackground
theme.colors.cardBorderedBackground: UIColorUsed as a background color for the cards with .bordered card style.
Default is nil.
Camera
cameraBackground
theme.colors.cameraBackground: UIColorThe Camera Screen background color.
Default is ● #1E232E.
cameraBackgroundOverlay
theme.colors.cameraBackgroundOverlay: UIColorThe Camera Screen overlay background color.
Default is ● #1E232E with alpha 75%.
cameraContent
theme.colors.cameraContent: UIColorUsed as a tint color for the elements placed on the Camera Screen such as the gallery button, the touch button, and so on.
Default is ● #FFFFFF.
Fields
fieldBackground
theme.colors.fieldBackground: UIColorThe background color of the input fields. Used for text fields.
Default is ● #F6F7F9 and ● #FFFFFF with alpha 7% for the dark appearance.
fieldBackgroundInvalid
theme.colors.fieldBackgroundInvalid: UIColorThe background color of the input fields marked as invalid. Used for text fields.
Default is the colors.backgroundCritical color.
fieldBorder
theme.colors.fieldBorder: UIColorThe border color of the input fields. Used for text fields.
Default is the clear color.
fieldPlaceholder
theme.colors.fieldPlaceholder: UIColorThe placeholder color of the input fields. Used for text fields.
Default is ● #94A0B8 and ● #FFFFFF with alpha 40% for the dark appearance.
fieldContent
theme.colors.fieldContent: UIColorThe content color of the input fields. Used for text fields.
Default is ● #333C4D and ● #FFFFFF with alpha 85% for the dark appearance.
fieldTint
theme.colors.fieldTint: UIColorThe tint color of the input fields. Used for text fields, checkboxes and radio buttons.
Default is ● #1693E9 and ● #1485D1 for the dark appearance.
List
listSeparator
theme.colors.listSeparator: UIColorThe list separator color.
Default is ● #D1D6E1 and ● #FFFFFF with alpha 20% for the dark appearance.
listSelectedItemBackground
theme.colors.listSelectedItemBackground: UIColorThe background color of the selected list item.
Default is ● #F6F7F9 and ● #FFFFFF with alpha 7% for the dark appearance.
Bottom Sheet
bottomSheetHandle
theme.colors.bottomSheetHandle: UIColorThe foreground color of the bottom sheet handle.
Note that the handle can be both inside (on bottomSheetBackground color) and outside (on the backgroundCommon color) of the bottom sheet.
Default is ● #D1D6E1 and ● #FFFFFF with alpha 20% for the dark appearance.
bottomSheetBackground
theme.colors.bottomSheetBackground: UIColorThe background color of the bottom sheet.
Default is ● #FFFFFF and ● #333C4D for the dark appearance.
Images
Icons
iconClose
theme.images.iconClose: UIImageUsed for the close bar button across all the screens.
Default is a cross icon.
iconBack
theme.images.iconBack: UIImage?Used for the back bar button.
Default is a back arrow icon. Setting to nil forces the system back button to be used instead.
iconSearch
theme.images.iconSearch: UIImageUsed for the search bar.
Default is a magnifying glass icon.
iconDisclosure
theme.images.iconDisclosure: UIImageUsed to indicate the disclosability.
Default is a simple disclosing arrow icon.
iconDropdown
theme.images.iconDropdown: UIImageUsed for dropdown fields.
Default is a down arrow icon.
iconCalendar
theme.images.iconCalendar: UIImageUsed for date fields.
Default is a calendar icon.
iconAttachment
theme.images.iconAttachment: UIImageUsed for attachments fields when the field is empty.
Default is a clip icon.
iconPicture
theme.images.iconPicture: UIImageUsed for attachments fields when the document is attached.
Default is a picture icon.
iconBin
theme.images.iconBin: UIImageUsed for attachments fields when the document can be removed.
Default is a trash bin icon.
iconTorchOn
theme.images.iconTorchOn: UIImageUsed for the turned-on flashlight button on the Camera Screen.
Default is a filled flash icon.
iconTorchOff
theme.images.iconTorchOff: UIImageUsed for the turned-off flashlight button on the Camera Screen.
Default is an outlined flash icon.
iconGallery
theme.images.iconGallery: UIImageUsed for the gallery button on the Camera Screen.
Default is a photos stack icon.
iconCameraToggle
theme.images.iconCameraToggle: UIImageUsed for the camera toggle button on the VideoIdent Screen.
Default is a rounded arrows icon.
iconRotate
theme.images.iconRotate: UIImageUsed for the rotation bar button on the Preview Screen.
Default is a photo rotation icon.
iconMail
theme.images.iconMail: UIImageUsed for the default E-Mail support item.
Default is a letter icon.
iconPlay
theme.images.iconPlay: UIImageUsed the play button on the Preview screen.
Default is a play icon in the circle.
iconNotice
theme.images.iconNotice: UIImageUsed on the verification comment block at the Status Screen.
Default is an exclamation mark in the triangle of 24x24 pixels.
iconCheckboxOff
theme.images.iconCheckboxOff: UIImageUsed for unmarked checkboxes.
Default is an empty rectangle icon with colors.contentWeak border color.
iconCheckboxOn
theme.images.iconCheckboxOn: UIImageUsed for marked checkboxes.
Default is a white checkmark icon on a background rectangle with colors.fieldTint color.
iconRadioButtonOff
theme.images.iconRadioButtonOff: UIImageUsed for unselected radio buttons.
Default is an empty circle icon with colors.contentWeak border color.
iconRadioButtonOn
theme.images.iconRadioButtonOn: UIImageUsed for selected radio buttons.
Default is a white circle icon on a background circle with colors.fieldTint color.
iconSuccess
theme.images.iconSuccess: UIImageUsed to compose the auto-generated pictureSuccess.
Default is a checkmark icon.
iconWarning
theme.images.iconWarning: UIImageUsed for the warnings bottom sheet and to compose the auto-generated pictureWarning.
Default is an exclamation mark in the triangle.
iconFailure
theme.images.iconFailure: UIImageUsed to compose the auto-generated pictureFailure.
Default is a cross icon.
iconSubmitted
theme.images.iconSubmitted: UIImageUsed to compose the auto-generated pictureSubmitted.
Default is an uploading-to-the-cloud icon.
Pictures
Could be used if you would like to override the large images composed on the basis of the corresponding icons.
pictureSuccess
theme.images.pictureSuccess: UIImage?The "success" image. Could be used if you would like to override the auto-generated one.
The auto-generated image looks like the iconSuccess icon in the circles composed on the basis of the colors.contentSuccess and colors.backgroundSuccess colors.
Default is nil.
pictureWarning
theme.images.pictureWarning: UIImage?The "warning" image. Could be used if you would like to override the auto-generated one.
The auto-generated image looks like the iconWarning icon in the circles composed on the basis of the colors.contentWarning and colors.backgroundWarning colors.
Default is nil.
pictureFailure
theme.images.pictureFailure: UIImage?The "failure" image. Could be used if you would like to override the auto-generated one.
The auto-generated image looks like the iconFailure icon in the circles composed on the basis of the colors.contentCritical and colors.backgroundCritical colors.
Default is nil.
pictureSubmitted
theme.images.pictureSubmitted: UIImage?The "submitted" image. Could be used if you would like to override the auto-generated one.
The auto-generated image looks like the iconSubmitted icon in the circles composed on the basis of the colors.contentWarning and colors.backgroundWarning colors.
Default is nil.
pictureGeolocationOn
theme.images.pictureGeolocationOn: UIImageUsed as the image on the Geolocation Screen before the start of the geolocation detection.
Default is a geolocation pin icon.
pictureGeolocationOff
theme.images.pictureGeolocationOff: UIImageUsed as the image on the Geolocation Screen when the app has no permissions to get the geolocation.
Default is a crossed geolocation pin icon.
pictureAgreement
theme.images.pictureAgreement: UIImage?Displayed at the top of the Agreement Screen.
Default is a globe decorated.
pictureDocumentFlip
theme.images.pictureDocumentFlip: UIImage?Displayed at the Camera Screen before the back side of a document is going to be captured.
Default is an ID document with a rotating arrow below.
Content driven sets
verificationStepIcons
theme.images.verificationStepIcons: [SNSVerificationStepKey: UIImage]
theme.images.setIcon(UIImage?, forVerificationStep: SNSVerificationStepKey, andState: SNSVerificationStepState)Verification steps icons.
One can assign an icon for a verification step either for all the verification states at once (as it is done by default) or more preciously if required.
Default icons are defined for the following keys: .identity, .selfie, .selfie2, .proofOfResidence, .proofOfResidence2, .applicantData, .emailVerification, .phoneVerification, .questionnaire and .ekyc.
Also the .default key is filled with the .identity icon.
documentTypeIcons
theme.images.documentTypeIcons: [SNSDocumentTypeKey: UIImage]Document types icons.
Default icons are defined for the following keys: .idCard, .passport, .drivers and .residencePermit.
Also the .default key is filled with the .idCard icon.
instructionsImages
theme.images.instructionsImages: [String: UIImage]Instructions pictures. When an image is referred with one of the following text keys:
sns_step_{STEP}_{scene}_instructions_imagesns_step_{STEP}_{scene}_instructions_doImagesns_step_{STEP}_{scene}_instructions_dontImage
the sdk will look through instructionsImages for the corresponding image object.
At that it takes the value of the text key and uses it as a key for instructionsImages dictionary.
Feel free to add your own pictures or use the predefined ones:
default/videoidentdefault/facescandefault/do_idCarddefault/dont_idCarddefault/do_passportdefault/dont_passportdefault/do_idCard_backSidedefault/dont_idCard_backSide
Metrics
Content Size
respectsPreferredContentSizeCategory
theme.metrics.respectsPreferredContentSizeCategory: BoolDefines whether the fonts, images, metrics and layouts should be adjusted in order to respect the user's preferred content size category.
Default is true.
Common
commonStatusBarStyle
theme.metrics.commonStatusBarStyle: UIStatusBarStyleThe status bar style on all the screens.
Default is .default.
activityIndicatorStyle
theme.metrics.activityIndicatorStyle: UIActivityIndicatorViewStyleThe loading spinner style.
Default is .medium for iOS 13+ and .gray for previous ones.
preferredCloseBarItemStyle
theme.metrics.preferredCloseBarItemStyle: SNSCloseBarItemStyleThe preferred style of the close bar button. The options are .icon and .text.
Default is .icon.
preferredCloseBarItemAlignment
theme.metrics.preferredCloseBarItemAlignment: SNSCloseBarItemAlignmentThe preferred alignment of the close bar button. The options are .right and .left.
Default is .right.
Content
screenHorizontalMargin
theme.metrics.screenHorizontalMargin: CGFloatThe horizontal margins of the screen content.
Default is 16pt.
Buttons
buttonHeight
theme.metrics.buttonHeight: CGFloatThe primary and secondary buttons height.
Default is 48pt.
buttonCornerRadius
theme.metrics.buttonCornerRadius: CGFloatThe primary and secondary buttons corner radius.
Default is 8pt.
buttonBorderWidth
theme.metrics.buttonBorderWidth: CGFloatThe secondary button border width. Bordered primary buttons are not supported at the moment.
Default is 1pt.
Camera
cameraStatusBarStyle
theme.metrics.cameraStatusBarStyle: UIStatusBarStyleThe status bar style on the Camera Screen. Not used at the moment.
Default is .default.
Document Frame
documentFrameBorderWidth
theme.metrics.documentFrameBorderWidth: CGFloatThe document frame's border width.
Default is 2pt.
documentFrameCornerRadius
theme.metrics.documentFrameCornerRadius: CGFloatThe document frame's corner radius.
Default is 14pt.
Fields
fieldHeight
theme.metrics.fieldHeight: CGFloatUsed for the text input fields on Email/Phone Confirmation screens.
Default is 48pt.
fieldBorderWidth
theme.metrics.fieldBorderWidth: CGFloatThe text input fields border width.
Default is 0pt.
fieldCornerRadius
theme.metrics.fieldCornerRadius: CGFloatThe text input fields corner radius.
Default is 8pt.
Viewport
viewportBorderWidth
theme.metrics.viewportBorderWidth: CGFloatThe selfie viewport border width.
Default is 8pt.
Bottom Sheet
bottomSheetCornerRadius
theme.metrics.bottomSheetCornerRadius: CGFloatThe bottom sheet corners radius.
Default is 16pt.
bottomSheetHandleSize
theme.metrics.bottomSheetHandleSize: CGSizeThe bottom sheet handle size.
Default is 36pt x 4pt.
Card Style
SNSCardStyle
enum SNSCardStyle {
case plain
case filled
case bordered
}- With
.plainstyle neither border nor background will be rendered by default (seecolors.cardPlainBackground). - With
.filledstyle the background will be filled out. - With
.borderedstyle a border will be rendered around the card (see alsocolors.cardBorderedBackground).
verificationStepCardStyle
theme.metrics.verificationStepCardStyle: SNSCardStyleThe verification steps card style.
Default is .filled.
verificationCommentCardStyle
theme.metrics.verificationCommentCardStyle: SNSCardStyleThe style of a verification comment block that can be displayed when the applicant is temporarily declined.
Default is .bordered.
supportItemCardStyle
theme.metrics.supportItemCardStyle: SNSCardStyleThe support items card style.
Default is .bordered.
documentTypeCardStyle
theme.metrics.documentTypeCardStyle: SNSCardStyleThe document types card style.
Default is .filled.
selectedCountryCardStyle
theme.metrics.selectedCountryCardStyle: SNSCardStyleThe selected country card style.
Default is .filled.
cardCornerRadius
theme.metrics.cardCornerRadius: CGFloatThe cards' corners radius.
Default is 8pt.
cardBorderWidth
theme.metrics.cardBorderWidth: CGFloatThe cards' border width. Used for the cards with the .bordered card style only.
Default is 1pt.
Alignment
screenHeaderAlignment
theme.metrics.screenHeaderAlignment: NSTextAlignmentThe alignment for the screen headers.
Default is .center
sectionHeaderAlignment
theme.metrics.sectionHeaderAlignment: NSTextAlignmentThe alignment for the section headers.
Default is .natural
Updated 2 days ago