Themes
Passtheme when creating Elements, or as part of an appearance update:
Variables
Override individual design tokens on top of a theme:Rule overrides
For finer control, target specific field states withrules. Only these 8 selectors are recognized — any other key is silently ignored, not an error:
.Input, .Input--focus, .Input--invalid, .Input--complete, .Input--disabled, .Label, .Error, .Icon.
Allowed CSS properties
What’s silently dropped
Elements strips anything that could be used to exfiltrate data or hide a field, rather than erroring — check your rendered field if a style doesn’t appear:- Values containing
url(),var(),attr(),expression(),paint(),element(),javascript:, or@import. - Sizes (
width,height,minHeight,maxWidth,fontSize) below 8px, or unparsable values likecalc(...). - Fonts outside the system font allowlist — see “Fonts” below.
Fonts
fontFamily only accepts system font-stack names (for example system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, serif, monospace). Custom web fonts aren’t supported — an unrecognized name falls back to system-ui, sans-serif.
Live updates
Update appearance after creation without remounting:Locales
Set a locale at init or per-Elements instance to localize field placeholders and validation messages:
en, zh, zh-TW, ms, id, th, vi, ja, ko. An unrecognized locale falls back to en.
Field-validation messages (
change.error.message) follow the locale. The required messages from Elements.getState() and Elements.submit(), and the SDK’s load-timeout message, are always English regardless of locale.Next steps
Content Security Policy
CSP directives your checkout page needs for Elements.