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> |
| Apple Pay express checkout | ExpressCheckoutElement | <bias-express-checkout-element> |
| Card and US bank account | 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> |
Compose payment surfaces
Mount ExpressCheckoutElement before contact and shipping fields to offer Apple Pay without waiting for the ordinary form. It renders only when Apple Pay is enabled for the session and available in the browser. Set showSeparator when ordinary checkout fields follow it.
For card and bank payments, mount exactly one ordinary payment surface under a provider:
PaymentElementshows the supportedcardandus_bank_accountmethods 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 ordinary payment surface, including a duplicate of the first, is a terminal configuration_error. ExpressCheckoutElement is separate and may be mounted alongside that ordinary surface.
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.