Skip to content

Theming

The SDK accepts an appearance configuration — a constrained set of variables like brand color and corner radius — so the hosted verification flow can read as part of your product rather than a third-party redirect.

Appearance values are validated against an allowlist before they ever reach the rendered flow, so a malformed or out-of-range value fails fast in your integration instead of silently rendering broken.

appearance rides the session mint, not the browser. You can pass it server-side (the appearance field of POST /v1/verification-sessions) or through the SDK’s create({ appearance }); either way PersonaBlocks validates it against a strict allowlist before it reaches the flow. Validation is all-or-nothing:

  • An unknown key, selector, or property → 400 invalid_appearance, and the response names the exact offending key (for example variables.colorBrand for an unknown variable, or theme for an unsupported preset).
  • An appearance object larger than 8192 bytes400 appearance_too_large.

There is no sanitize-and-continue path: one bad key rejects the whole object.

theme selects a preset base that the rest of your appearance layers on top of. It must be one of 'light', 'dark', or 'minimal'.

variables is a flat map of design tokens. Every key must be one of these 23 names — any other name is rejected.

VariablePurpose
colorPrimaryPrimary brand / accent color.
colorBackgroundSurface background color.
colorTextDefault body text color.
colorTextSecondaryMuted / secondary text color.
colorDangerError and destructive-state color.
colorSuccessSuccess-state color.
accessibleColorOnColorPrimaryForeground color used on top of colorPrimary (contrast pair).
VariablePurpose
fontFamilyFont stack for the flow.
fontSizeBaseBase font size.
fontWeightNormalNormal text weight.
fontWeightBoldBold / emphasis weight.
VariablePurpose
spacingUnitBase spacing unit that layout scales from.
borderRadiusGlobal corner radius.
buttonBorderRadiusCorner radius for buttons specifically.
VariablePurpose
focusBoxShadowFocus-ring box shadow.
inputColorBorderInput border color at rest.
inputFocusColorBorderInput border color on focus.
colorBackgroundButtonPrimaryHoverPrimary button background on hover.
colorBackgroundButtonPrimaryActivePrimary button background while pressed.
colorBackgroundSurfaceModalModal / dialog surface background.
VariablePurpose
colorCameraOverlayDimming overlay around the camera frame.
colorCameraGuideCapture guide / outline color.
VariablePurpose
logoUrlYour logo. Must be an https:// URL, 2048 characters or fewer.

For finer control, rules maps a component selector to a set of camelCase CSS properties. Selectors are strictly limited to these 10 documented component classes:

.Button, .Button--primary, .Input, .Input--invalid, .Label, .Error, .Step, .ProgressBar, .CameraFrame, .Modal

A selector may carry one optional pseudo-class suffix — :hover, :focus, :focus-visible, :active, or :disabled (for example .Button--primary:hover). Chained pseudo-classes, descendant combinators, attribute selectors, and bare element/id/universal selectors are all rejected.

Property names come from the 62-property CSS allowlist — purely visual box, typography, and color properties, written in React camelCase (backgroundColor, not background-color). Common ones include color, backgroundColor, border, borderRadius, boxShadow, padding, margin, fontFamily, fontSize, fontWeight, textAlign, and opacity. Anything that could break layout or escape a component’s box — position, content, filter, zIndex, pointerEvents, and any url() value — is rejected.

{
"theme": "light",
"variables": { "colorPrimary": "#0F4D92", "borderRadius": "8px", "fontFamily": "Inter, sans-serif" },
"rules": { ".Button--primary:hover": { "backgroundColor": "#0a3364" } }
}

This sets a light base, overrides the brand color, corner radius, and font, and darkens the primary button on hover. Pass the same object to create({ appearance }) or to the session-mint API’s appearance field.

  • SDK reference — where appearance sits among the other create() options.
  • Venues — the flows your theme renders across.