Styling individual guidance messages
Every guidance message the SDK renders carries a data-guidance-code attribute naming which message it is. That gives you a CSS hook to restyle one specific message — colour it, add an icon, change its weight — without the SDK having to ship an opinion about which messages count as “errors” and which are routine status.
<div class="idm-pill" data-guidance-code="GLARE">
Please reduce glare on the document
</div>Your theme’s guidanceMessages colours still apply exactly as before. This attribute is purely additive: it changes nothing until you write a rule against it.
Making your rules win
The guidance pill’s background comes from a styled-components class, which has the same CSS specificity as a bare attribute selector. Because those styles are injected at runtime, they land after your stylesheet in the cascade. So this looks correct and does nothing at all:
/* Same specificity as the SDK's own rule, and loses on source order. */
[data-guidance-code="GLARE"] {
background: #b26b00;
}Pair the attribute with a class name you already pass to the SDK. Two selectors beat one, so your rule wins cleanly and you do not need !important:
<IdValidation classNames={{ guidanceMessage: "idm-pill" }} />/* Specificity 0,2,0 — outranks the SDK's class. */
.idm-pill[data-guidance-code="GLARE"] {
background: #b26b00;
color: white;
}The exact path to the class name prop differs per flow and per stage — check the Class names table for the flow you are using. The guidance pill is guidanceMessage.
Grouping messages by severity
There is deliberately no severity attribute. If the SDK shipped its own grouping, then changing our mind about a bucket later would silently restyle your integration. CSS already groups things perfectly well, and in your stylesheet the categorisation stays under your control.
/* Warnings: the shot is being spoiled — change your grip or your environment. */
.idm-pill[data-guidance-code="FINGER_OCCLUSION"],
.idm-pill[data-guidance-code="GLARE"],
.idm-pill[data-guidance-code="HOLOGRAM_REFLECTION"],
.idm-pill[data-guidance-code="OUT_OF_FOCUS"] {
background: var(--idm-color-warning-400);
color: white;
}
/* Errors: you cannot proceed with what you are currently holding. */
.idm-pill[data-guidance-code="ID_CARD_NOT_ALLOWED"],
.idm-pill[data-guidance-code="PASSPORT_NOT_ALLOWED"] {
background: var(--idm-color-negative-600);
color: white;
}
/* Face capture: poor lighting is a warning, not a status update. */
.idm-pill[data-guidance-code="VISIBILITY_TOO_LOW"] {
background: var(--idm-color-warning-400);
color: white;
}Stability guarantee
The code vocabulary is append-only. We will add codes as we add messages, but we will never rename, remove, or repurpose an existing one. Your selectors are not type-checked against our source, so a rename would fail silently in your production integration rather than loudly at build time. This guarantee is enforced by a test in the SDK’s own build.
The text a code maps to is not frozen. Messages get reworded, and they are translated into nine locales. Never key styling off the message text itself.
Reference
The code always names the message actually on screen, not the internal state that produced it. Where no message is displayed, no attribute is emitted.
ID capture
| Code | Message |
|---|---|
HOLD_STILL | <document type> detected, hold still… |
NO_DOCUMENT | Document not detected |
BACK_DETECTED_FLIP | ID card back detected - please flip your ID card |
FRONT_DETECTED_FLIP | ID card front detected - please flip your ID card |
ID_CARD_NOT_ALLOWED | ID card detected, please scan a passport instead |
PASSPORT_NOT_ALLOWED | Passport detected, please scan an ID card instead |
BOOKLET_CORNERS_CUT_OFF | Move back, make sure all 4 corners of your fully opened passport booklet are visible. |
BOOKLET_TOO_FAR | Move closer, fill the frame with your fully opened passport booklet. |
NOT_CENTERED | Document is not centered |
TOO_CLOSE | Document too close, please back up |
FINGER_OCCLUSION | Please move your fingers off the document |
GLARE | Please reduce glare on the document |
HOLOGRAM_REFLECTION | Please reduce reflections on the document |
NOT_STABLE | Please hold your ID document steady |
OUT_OF_FOCUS | Document out of focus - try improving the lighting |
BARCODE_MOVE_CLOSER | Please move the barcode closer to the camera |
BARCODE_HOLD_STILL | Barcode capture in progress, please hold still |
HOLD_STILL covers all four detected-document variants (ID front, ID back, passport, and single page) — the document type is interpolated into the text, so one code serves them all.
The two BARCODE_* codes only appear during barcode re-capture, which runs after an ID card back capture and only when enableBarcodeRecapture is switched on. They never appear during an ID front or passport scan. They also render in the guide box header rather than in the pill, so pair them with the guides’ instruction class name rather than guidanceMessage.
Face capture — guidance
| Code | Message |
|---|---|
HOLD_STILL | Hold still for a few seconds… |
VISIBILITY_TOO_LOW | Improve lighting conditions… |
NO_FACE_DETECTED | Waiting for face to be detected… |
MOVE_TO_CENTER | Move to the center… |
LOOK_STRAIGHT | Look straight into the camera… |
MOVE_BACK | Move back… |
MOVE_FORWARD | Move forward… |
NOT_STABLE | Please hold still… |
Face capture — liveness and challenge
| Code | Message |
|---|---|
TURN_LEFT | Turn your head left |
TURN_RIGHT | Turn your head right |
RETURN_TO_CENTER | Return to center |
BLINK | Blink |
BLINK_TWICE | Blink twice |
REMOVE_EYE_COVERINGS | Please remove your eye coverings (sunglasses, eye patch, etc.)… |
REMOVE_HEAD_COVERINGS | Please remove your head coverings (hat, scarf, etc.)… |
REMOVE_MASK | Please remove your mask… |
CHALLENGE_TIMED_OUT | Let’s try that again — please follow the prompts. |
LIVENESS_CHECK_FAILED | Could not verify your face. |
LIVENESS_CHECK_ERROR | An error occurred while verifying your face. |
VALIDATING | Photo captured, verifying… |
MANUAL_CAPTURE | Position your face in the circle and click to capture. |
The challenge prompts render with your theme’s positive colours by default, because the challenge is only ever entered from an already-satisfied face. If you would rather they read as neutral status, restyle them by code.
Signature capture
| Code | Meaning |
|---|---|
SIGN_HERE | Prompting for a signature |
KEEP_SIGNING | Signature started, but still too short to accept |
READY_TO_ACCEPT | Signature is acceptable |
PROCESSING | Submitting the signature |
Video ID capture
| Code | Meaning |
|---|---|
SHOW_ID_FRONT | Prompting for the front of the ID |
FLIP_ID | Prompting the user to flip the document |
SHOW_ID_BACK | Prompting for the back of the ID |
SHOW_PASSPORT | Prompting for a passport |
SEARCHING_FOR_ID | No document found yet |
HOLD_STEADY | Document found, holding steady for capture |
READ_TEXT | The read-aloud stage |