@ozura/elements/react ships a context provider, hooks, and pre-built field components for both card and bank payments.
Installation
OzElements Provider
Wrap your checkout UI with<OzElements>. It creates the OzVault instance and makes it available to all children via React context. A session option is required. pubKey is required when using a production vault API key; omit it when using a test/sandbox vault API key.
sessionUrl is the simplest option — just pass your session endpoint path. See Server SDK — Session route for the matching backend route.
For custom headers or auth tokens, use getSessionKey instead:
OzElements props
¹ Exactly one of
sessionUrl, getSessionKey, or fetchWaxKey is required.
² pubKey is required when using a production vault API key. If your vault API key was created for the test/sandbox environment, you can omit pubKey entirely.
useOzElements Hook
UseuseOzElements() inside any component wrapped by <OzElements> to tokenize and track readiness.
useOzElements return values
ready is a composite flag. It is true only when the vault is ready AND every field component that has been mounted has also finished loading. Do not use vault.isReady directly — that only reflects vault readiness, not field readiness.OzCard — Combined Card Component
OzCard renders card number, expiry, and CVV in a single component with built-in layout, loading skeletons, and inline error display. For maximum layout control, use the individual components instead.
OzCard props
OzCardState
Individual Card Components
UseOzCardNumber, OzExpiry, and OzCvv when you need full layout control.
The expiry component is exported as
OzExpiry, not OzExpirationDate.OzFieldProps (all individual field components)
OzBankCard — Combined Bank Component
OzBankCard renders account number and routing number in a single component with built-in layout, loading skeletons, and inline error display.
OzBankCard props
OzBankCardState
Individual Bank Components
UseOzBankAccountNumber and OzBankRoutingNumber for full layout control. They accept the same OzFieldProps as card fields.
Full Card Checkout Example
Next Steps
Styling
Customize field appearance with style config and global appearance.
Error Handling
Handle OzError codes and surface them to users.
Card Elements Reference
All card options, events, and methods.
Bank Elements Reference
All bank options, events, and methods.