Assetera Docs
Distribution partners

Styling the KYC SDK

Three ways to restyle the embedded KYC flow, why overriding from your own stylesheet needs care, and every CSS class and theme variable the SDK supports.

There are three ways to change how the SDK looks. Use the highest one that does the job, because each is more coupled to SDK internals than the one above it.

#RouteWhere it livesUse it for
1Theme configurationAdmin panel, or the theme config objectColours, fonts, spacing. No CSS at all.
2customCSSProvider config at initAnything the theme does not expose. Always wins inside the SDK.
3Your own stylesheetYour app's CSSWhen the CSS must live in your codebase. Read the rules below first.

How the SDK's CSS reaches the page

There is no Shadow DOM, so every element is reachable from your stylesheet. On mount the SDK appends three <style> elements to <head>, in this order.

Element idContents
metakyc-sdk-stylesThe component stylesheet, scoped under .metakyc-sdk.
metakyc-theme-varsThe --metakyc-* variables for the resolved theme.
metakyc-custom-cssYour customCSS, appended last so it wins.

Two things make route 3 harder than it looks

Every theme variable is emitted with !important, and these style elements are appended at runtime, so they sit after your build-time stylesheet in <head>. A rule of equal specificity loses on document order. To win from your own CSS you need !important and a selector more specific than .metakyc-sdk.

What does not work

AttemptWhy it fails
:root { --metakyc-primary: ... }The variable is declared directly on the .metakyc-sdk element, and a direct declaration always beats an inherited one.
.metakyc-sdk { ... !important }Ties on specificity, then loses on document order because the SDK's style element is appended later.
Any rule without !importantLoses to the !important on the SDK's own declaration.

The first of those is the one to watch: :root is what most people reach for, and it fails silently.

The pattern that works

Pass your own class through className. It lands on the same element as .metakyc-sdk, so .my-kyc.metakyc-sdk is strictly more specific and wins regardless of injection order.

<MetaKYC className="my-kyc" />
/* Your stylesheet. Override the VARIABLES, not the properties. */
.my-kyc.metakyc-sdk,
.metakyc-searchable-select-dropdown,
.metakyc-multiselect-dropdown {
  --metakyc-primary:      #5046D5 !important;
  --metakyc-input-bg:     #ffffff !important;
  --metakyc-input-border: #d1d5db !important;
  --metakyc-font-family:  'Inter Tight', sans-serif !important;
}

Override variables, not properties

The SDK's component rules are !important, but their values read var(--metakyc-*). Winning the variable therefore reaches every rule that uses it. Beating a property directly means out-specifying selectors such as .metakyc-sdk input:not([type="checkbox"])..., which is far more work for the same result.

Dropdowns render outside the shell

The searchable select and multi-select dropdowns are portalled to document.body, so they are not inside .metakyc-sdk. Repeat your variable block on .metakyc-searchable-select-dropdown and .metakyc-multiselect-dropdown, or those two controls keep the old palette.

Theme variables

Every variable below is settable, and every variable the stylesheet reads is in this list. Names are prefixed --metakyc-.

GroupVariables
Brandprimary, primary-hover, primary-light, primary-dark, secondary, secondary-hover
Statussuccess, warning, danger, info
Status backgroundssuccess-bg, warning-bg, danger-bg, info-bg
Surfacesbackground, surface, border
Texttext-primary, text-secondary, text-muted
Inputsinput-bg, input-text, input-border, input-border-focus, input-placeholder
Header and footerheader-bg, header-text, footer-bg, footer-text
Typographyfont-family, heading-font, font-size-*, font-weight-* (one per key in your theme)
SpacingOne variable per key in the theme's spacing object, kebab-cased

CSS classes

These are the supported styling hooks. Treat anything not listed here, and every Tailwind utility class in the markup, as internal and liable to change.

Shell and layout

ClassElement
metakyc-sdkThe root shell wrapping everything. Your className is appended here.
metakyc-vertical-layoutVertical (stepper beside content) layout container.
metakyc-form-gridGrid that lays out form fields.
metakyc-headerHeader bar.
metakyc-header-titleTitle text in the header.
metakyc-logoTenant logo.
metakyc-paragraphBody copy block rendered from configuration.

Card

ClassElement
metakyc-card-headerCard header region.
metakyc-card-contentCard body region.
metakyc-card-footerCard footer region, usually the action buttons.

Stepper and progress

ClassElement
metakyc-progress-wrapperWrapper around the whole progress indicator.
metakyc-stepper-scrollScrollable strip holding the steps.
metakyc-step-iconPer-step icon or number badge.
metakyc-step-labelPer-step label.
metakyc-step-label--currentAdded to the label of the active step.
metakyc-step-titleTitle of the step being rendered.
metakyc-step-descriptionDescription under the step title.
metakyc-step-contentThe active step's content area.
metakyc-step-connectorConnector line drawn between steps.
metakyc-overview-step-itemOne row in the overview (summary) step.

Fields and options

ClassElement
metakyc-field-labelLabel above a form field.
metakyc-input-labelLabel bound to a text input.
metakyc-options-groupGroup wrapping radio or checkbox options.
metakyc-option-inputThe radio or checkbox control itself.
metakyc-option-labelClickable label around one option.
metakyc-option-textText of one option.
metakyc-link-fieldField rendered as a link, for example a consent document.
metakyc-help-btnThe inline help button next to a field.

Searchable select

ClassElement
metakyc-searchable-select-triggerThe closed control you click to open it.
metakyc-searchable-select-dropdownThe open panel. Portalled outside the shell.
metakyc-searchable-select-optionOne option row.
metakyc-searchable-select-searchThe search input inside the panel.

Multi-select

ClassElement
metakyc-multiselectWrapper around the control.
metakyc-multiselect-triggerThe closed control.
metakyc-multiselect-dropdownThe open panel. Portalled outside the shell.
metakyc-multiselect-optionOne option row.
metakyc-multiselect-searchThe search input inside the panel.
metakyc-multiselect-placeholderPlaceholder shown when nothing is selected.
metakyc-multiselect-arrowThe open and close chevron.
metakyc-multiselect-chipOne selected value, shown as a chip.
metakyc-multiselect-chip-removeThe remove control on a chip.

File upload and cascading tree

ClassElement
metakyc-file-uploadThe upload control as a whole.
metakyc-file-dropzoneThe drag and drop target.
metakyc-file-itemOne uploaded file row.
metakyc-cascading-treeWrapper for a cascading (parent and child) selector.
metakyc-cascading-tree-levelsThe container holding its levels.

Prefer the theme first

If a colour or font is all you need, set it in the admin panel or the theme object and skip CSS entirely. Pin it with configVersion (see KYC integration) so a later change to the live configuration cannot move your UI unexpectedly.

On this page