Customize icons, colors, and backgrounds for the guide page, certificate capture page, OCR editing page, and liveness detection page in the PC Web SDK.
Configuration method
Pass a JSON string with your custom styles to the StyleConfig field of the server-side Initialize method.
Configuration rules and recommendations:
Default inheritance: If a configuration item or its style property is not specified, the system uses the default value.
Incremental configuration: To reduce the request body size, pass only the configuration items that you need to modify. Unspecified items use their default values.
The JSON string must not contain regular expression special characters.
Configuration template
JavaScript
const styleConfig = {
guidePage: {
step1Icon: "", // The icon for Step 1. The image dimensions (width × height) are 200 × 200.
step2Icon: "", // The icon for Step 2. The image dimensions (width × height) are 200 × 200.
pathIcon: "", // The icon for the connecting line between steps. The image dimensions (width × height) are 320 × 3.
startBtnBgColor: "#FF6A00", // The background color of the Start Authentication button. Default value: #FF6A00.
startBtnTextColor: "#FFFFFF", // The text color of the Start Authentication button. Default value: #FFFFFF.
},
ocrPage: {
backIcon: "", // The icon for the Back button. The image dimensions (width × height) are 24 × 24.
uploadIcon: "", // The icon for Upload. The image dimensions (width × height) are 16 × 16.
uploadTextColor: "#FF6A00", // The color of the upload text. Default value: #FF6A00.
submitBtnBgColor: "#FF6A00", // The background color of the Submit button. Default value: #FF6A00.
submitBtnTextColor: "#FFFFFF", // The text color of the Submit button. Default value: #FFFFFF.
},
alert: {
top: "45%", // The distance from the top of the pop-up window. Default value: 45%.
left: "50%", // The distance from the left of the pop-up window. Default value: 50%.
width: "480px", // The width of the pop-up window. Default value: 480px.
primaryBtnBgColor: "#FF6A00", // The background color of the primary button. Default value: #FF6A00.
primaryBtnTextColor: "#FFFFFF", // The text color of the primary button. Default value: #FFFFFF.
btnBgColor: "#FFFFFF", // The background color of the secondary button. Default value: #FFFFFF.
btnBgTextColor: "#FF6A00", // The text color of the secondary button. Default value: #FF6A00.
btnBorder: "1px solid #FF6A00", // The border style of the secondary button. Default value: 1px solid #FF6A00.
}
};JSON
{
"guidePage": {
"step1Icon": "",
"step2Icon": "",
"pathIcon": "",
"startBtnBgColor": "#FF6A00",
"startBtnTextColor": "#FFFFFF"
},
"ocrPage": {
"backIcon": "",
"uploadIcon": "",
"uploadTextColor": "#FF6A00",
"submitBtnBgColor": "#FF6A00",
"submitBtnTextColor": "#FFFFFF"
},
"alert": {
"top": "45%",
"left": "50%",
"width": "480px",
"primaryBtnBgColor": "#FF6A00",
"primaryBtnTextColor": "#FFFFFF",
"btnBgColor": "#FFFFFF",
"btnBgTextColor": "#FF6A00",
"btnBorder": "1px solid #FF6A00"
}
}Configuration reference
Page colors: Replace default component colors with custom color values.
Icons: Replace default icons with custom images. Size and position are fixed.
Frame styles: Replace default frames with custom resources. Size and position are fixed.
Module page | Element | Description | Configuration item | Details |
Guide page | Step icons | Replaceable | |
|
Button background color/Button font color | None | |
| |
Certificate capture page | Back button icon/Upload image icon | None | |
|
Upload text style | None | | Upload text color. Default: | |
Submit button style | None | |
| |
Dialog style | Distance from the top | None | | Distance from top. Default: |
Distance from the left | None | | Distance from left. Default: | |
Width | None | | Dialog width. Default: | |
Primary button style:
| None | |
| |
Secondary button style:
| None | |
|