Elements integration
Install a checkout elements package, render a payment form, and handle completion.
This page covers all three client packages. Choose the section that matches your stack:
Before starting, create a checkout session on your server and make the client_secret available to your frontend.
React
Installation
Provider setup
Wrap your payment page in BiasProvider. Pass the clientSecret from your checkout session and an onComplete callback.
BiasProvider accepts these props:
| Prop | Type | Description |
|---|---|---|
clientSecret | string | The checkout session client secret. Required. |
onComplete | () => void | Called after a successful payment. |
apiBaseUrl | string | Override the Bias API base URL (useful for testing). |
Pre-built forms
The fastest path is a pre-built form component. PaymentForm renders card and bank account methods with a submit button, validation, and error display.
If you only need one payment method, use CardForm or BankAccountForm instead.
Form props
All three form components accept these optional props:
| Prop | Type | Default | Description |
|---|---|---|---|
compact | boolean | false | Render a more compact layout. |
style | "tab" | "radio" | "tab" | Payment method selection style (PaymentForm only). |
variables | ThemeVariables | — | Override theme variables. |
For example:
For full layout control using individual field components and hooks, see custom forms.
SolidJS
Installation
Note
@biaspay/solid requires SolidJS 2.0 beta (solid-js@2.0.0-beta.7 and
@solidjs/web@2.0.0-beta.7).
API surface
The Solid package wraps @biaspay/web and exposes matching checkout components and hooks for Solid applications:
Differences from React
BiasProvider’sclientSecretprop accepts either astringor anAccessor<string>for reactive updates.- Hooks that return reactive values (like
useIsSubmittable,useSubmitState,usePaymentError,useSelectedPaymentMethod) return Solid accessors (functions) instead of plain values. Call them to read the current value.
Example
For custom form composition in Solid, see custom forms.
Web components
Installation
Registering elements
Import @biaspay/web once on the page where you render checkout. The package registers the Bias custom elements with the browser.
Provider setup
Wrap the form in <bias-provider> and pass the checkout session client secret with the client-secret attribute. Listen for the complete event to redirect or update your page after a successful payment.
<bias-provider> accepts these attributes:
| Attribute | Description |
|---|---|
client-secret | The checkout session client secret. Required. |
api-base-url | Override the Bias API base URL (useful for testing). |
frame-url | Override the secure field iframe URL. |
Pre-built forms
Use a pre-built form element inside <bias-provider>.
If you only need one payment method, use <bias-card-form> or <bias-bank-account-form> with <bias-submit-button>.
Form attributes and styling
<bias-payment-form> accepts these attributes:
| Attribute | Description |
|---|---|
compact | Render a more compact layout. |
list-style | Payment method selection style: "tab" or "radio". |
Use CSS custom properties to style the form:
Complete example
For the full web components API, see the web components reference.