Skip to main content
Elements fields render inside iframes, so you can’t target them with your page’s CSS. Instead, you pass a style configuration object that the SDK applies inside each iframe.

Style Config Shape

Each key maps to an ElementStyle object where the keys are camelCase CSS properties.

Passing Styles

Per-element — pass style in the options when creating an element:
Global default — pass appearance when calling OzVault.create(). It accepts an Appearance object with an optional theme preset and/or variables overrides. All elements inherit this; per-element style merges on top.

Themes

The theme preset provides a complete set of defaults. Available themes: You can combine theme + variables — the theme applies first, then variables override on top.
Omitting theme is not the same as no theme. Passing appearance: {} or appearance: { variables: { ... } } without a theme key applies the 'default' preset as a base. To render elements with no preset styling at all, omit the appearance prop entirely and use per-element style overrides.

AppearanceVariables


Supported Style Properties

Typography

Spacing & Box

Background & Border

Sizing

Caret

Transitions & Cursors

Properties like position, display, and width that could affect iframe layout are not supported. Use height / minHeight to control the field’s vertical size.
CSS custom properties (var(--token)) are not accepted in style values. The style sanitizer blocks all CSS function syntax, including var(), to prevent CSS injection through the iframe boundary. Pass literal values only:
When a value is blocked, the SDK strips it silently — no error is thrown and no console warning is emitted. The browser falls back to the element’s default (unstyled) appearance for that property. If your design tokens resolve to CSS variables, resolve them to their literal values before passing them in.

Custom Fonts

To use a custom web font inside the iframes, pass a fonts array to OzVault.create(). You can reference a Google Fonts URL:
Or a self-hosted font:

Complete Example


Reflecting State with CSS Classes

Combine the change event with CSS classes on your wrapper element to style the border and background based on field state:

Updating Styles at Runtime

Call element.update({ style: { ... } }) to restyle a field without re-mounting it:
Style update semantics:
  • Properties you include are merged into the current style — they replace their previous values.
  • Properties previously set but absent from the new style object retain their current values (no keys are cleared by omission).
  • To reset a specific property, pass it explicitly with an empty string: { base: { color: '' } }.
  • To fully reset all styles, destroy and recreate the element.
  • Global vault appearance theme styles are always preserved underneath.
In React, use the style prop on individual field components — it is applied on every render.

React

In React, pass appearance to <OzElements> and style to individual field components:

Next Steps

Card Elements

All card field options and events.

Bank Elements

All bank field options and events.