Card

The card-collection element. Wraps an Evervault card iframe and, when configured, renders billing-address and identity-field sections alongside it.

Construct via frame.createElement('card', options) — do not call the constructor directly.

Listen for change and complete events to drive your submit button's enabled state. Pass the instance to frame.confirmCardPayment when the customer is ready to pay.

EXAMPLE
import Frame from '@framepayments/frame-js';

const frame = await Frame.init('pk_test_...');
const card = await frame.createElement('card', { billing: true });

card.on('complete', () => {
  submitButton.disabled = false;
});

card.mount('#card-container');

Element options

billingbooleanoptional

When true, renders a billing address form below the card iframe.

cardThemeunknownoptional

Theme object for the Evervault card iframe. Use frame.cardTheme(preset) to construct one. Styles only the card iframe — does not affect billing address or identity fields.

identityFieldsIdentityFieldsOptionsoptional

When set, renders an identity-fields section above the card iframe.

[key: string]unknownoptional

Any remaining keys are forwarded to the Evervault card iframe (autoFocus, fields, translations, etc.). See Evervault's docs for the full list.

Methods