Skip to main content
Elements ships four built-in themes and a small, safety-checked set of CSS variables and rule overrides — enough to match your brand without opening the card iframe to arbitrary CSS.

Themes

Pass theme 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 with rules. 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 like calc(...).
  • 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:
update() replaces the whole rule for any selector you pass — it doesn’t merge with the current value, including the theme’s own default for that selector. Pass every property you want the selector to end up with, not just the ones that changed.

Locales

Set a locale at init or per-Elements instance to localize field placeholders and validation messages:
Supported locales: 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.
Last modified on September 15, 2026