Components and appearance
Choose the fields your checkout needs, then apply an appearance at the provider or individual component level.
Component map
The framework components are thin wrappers around the corresponding custom elements.
| Purpose | React and Solid | Web component |
|---|---|---|
| Checkout state and config | BiasProvider | <bias-provider> |
| All enabled payment methods | PaymentElement | <bias-payment-element> |
| Card only | CardElement | <bias-card-element> |
| US bank account only | USBankAccountElement | <bias-us-bank-account-element> |
ContactElement | <bias-contact-element> | |
| Billing or shipping address | AddressElement | <bias-address-element> |
| Submission | SubmitButton | <bias-submit-button> |
Choose one payment surface
Mount exactly one payment surface under a provider:
PaymentElementshows every supported method in the checkout session. ItspaymentMethodLayoutis"tabs"by default and can be"radio".CardElementselects card and only renders card fields. The session must enablecard.USBankAccountElementselects a US bank account and only renders bank fields. The session must enableus_bank_account.
Mounting a second payment surface, including a duplicate of the first, is a terminal configuration_error.
Collect shopper details
ContactElement collects and saves the shopper’s email. AddressElement accepts:
| Option | Type | Default |
|---|---|---|
scope | "billing" | "shipping" | "billing" |
collectPhone | boolean | false |
appearance | Appearance | Inherited |
A billing address is attached to the payment method. A shipping address is saved to the checkout session. When both address scopes are present, the billing form can offer to reuse the shipping address. Contact and address values autosave while the shopper fills out the form and are flushed before payment submission.
Only mount fields your checkout needs. A mounted contact or address component registers its fields as required; an unmounted component does not block submission.
Configure appearance
Set appearance on the provider to theme the whole tree. Set it on a payment, contact, or address component to override that subtree. Component variables merge by key with provider variables, and component-level labelStyle wins.
For web components, assign structured values as DOM properties:
HTML attributes only carry strings, so an appearance attribute cannot represent this object.
Appearance options
labelStyle accepts "static", "floating", or "placeholder". The default is "static".
variables accepts optional CSS values for:
| Category | Variables |
|---|---|
| Colors | colorPrimary, colorBackground, colorInput, colorForeground, colorMutedForeground |
| Feedback | colorPlaceholder, colorBorder, colorSuccess, colorError, focusRing |
| Shape | borderRadius, shadow |
| Typography | fontFamily, fontSize |
| Spacing | gap |
Replace the appearance object when updating it. Removing a variable from the new object removes the package-applied override and restores inheritance or the default.
SubmitButton has no component-level appearance prop. It inherits the provider theme and accepts only disabled and label.