- Inline styles: Apply React
CSSPropertiesto individual elements throughstyles - Design tokens: Override the checkout’s colors, borders, focus ring, and hover states through
cssVariables
Inline Styles
React CSS properties for precise control over individual form elements.
Design Tokens
CSS variables that restyle the whole checkout, including focus and hover states.
The checkout renders inside a secure iframe. Your page’s stylesheets, CSS classes, CSS custom properties, and fonts don’t reach it, so style the checkout only through
styles and cssVariables. See Migrate to SDK 2.0.Implement Brand Styles
Pass your brand values to the checkout directly. Set theme-wide tokens withcssVariables, then fine-tune individual elements with styles:
Configure StylesConfig
TheStylesConfig interface provides styling options for all checkout form elements.
Define your
StylesConfig objects and pass them into the styles property when calling checkout.mount('element-id', { ...config, styles }), following the pattern in Mount the Checkout.Core Elements
InputStyles
Configure card number, expiry, CVC, cardholder name, etc.
ISubmitButtonStyles
Styles for the payment submit button.
Digital Wallet Buttons
IApplePayButtonStyles
Apple Pay button styling following Apple’s guidelines.
IPayPalButtonStyles
PayPal button styling following PayPal specifications.
IGooglePayButtonStyles
Google Pay button styling.
HTMLStyles
Cash App Pay button styling (Stripe wallets only).
HTMLStyles
Styles for generic wallet buttons (e.g., custom wallet implementations).
HTMLStyles
Styles for Braintree payment buttons.
Pix Button
HTMLStyles
Styles for the Pix button in the payment method list. The button shows the Pix icon without a label, so text properties have no effect — use
styles for the surface itself: background, border, height, and radius. Defaults are a full-width 40px button with a white background, an #e0e0e0 border, and the theme’s border radius. The dark theme uses a #1a1a1a background with a #333 border.pix-button.constant.ts
Pix Form
PixFormStyles
Overrides for the Pix form’s embedded Stripe Payment Element — the email, CPF/CNPJ, and name fields, plus the QR code step. Unlike the other elements on this page, these map to Stripe’s Appearance API variables instead of React
CSSProperties, since the Pix form renders inside a Stripe-hosted iframe.Every field is optional — fields you don’t set keep the active theme’s default. Overrides apply to both recurring Pix Automático and one-time Pix, and re-apply immediately if the theme changes while the form is open. See Pix Form Theming.
pix-form.constant.ts
BLIK Button
HTMLStyles
Styles for the BLIK button in the payment method list. The button shows the BLIK mark without a label, so text properties have no effect — use
styles for the surface itself: background, border, height, and radius. The default is a full-width 40px black tile (#000000 background and border) with the theme’s border radius. Unlike the other payment buttons it is black in both themes, because the BLIK mark is white on black; the dark theme only softens the border to #333.blik-button.constant.ts
BLIK Form
BlikFormStyles
Overrides for the BLIK form’s embedded Stripe Payment Element, where the customer enters the six-digit code from their banking app.
BlikFormStyles has the same shape as PixFormStyles: the fields map to Stripe’s Appearance API variables instead of React CSSProperties, since the BLIK form renders inside a Stripe-hosted iframe.Every field is optional — fields you don’t set keep the active theme’s default, and overrides re-apply immediately if the theme changes while the form is open. See BLIK Form Theming.
blik-form.constant.ts
HTMLStyles
Styles for the back button wrapper that sits above the card form (hidden when the default variant hides the control). Defaults include a 30x30px flex container with centered content, a
#f4f4f5 background, and 8px border radius.CSSVariablesConfig
Override the SDK design tokens directly from
styles without adding external stylesheets. Values apply to the checkout root element and merge with the active theme.Leave any variable undefined to keep the theme default. See Theme Support › CSS Variables for the complete token list and defaults.
css-variables.constant.ts
Element-level styling properties accept
Wallet button styling must also follow each processor’s brand guidelines (Apple, PayPal, Google) to remain compliant.
styles (React CSSProperties), while cssVariables overrides global tokens for the entire checkout. Inline styles can’t express pseudo-states such as :hover or :focus — use the hover and focus tokens in cssVariables for those.Wallet button styling must also follow each processor’s brand guidelines (Apple, PayPal, Google) to remain compliant.
Use Advanced Styling Patterns
These examples demonstrate real-world styling patterns used by production applications. Each example includes performance optimizations and accessibility considerations.All examples below show only the
StylesConfig object. Pass it to checkout.mount('element-id', { ...config, styles }) as shown in Mount the Checkout.- CSS Variables Only
- Enhanced Input Styling
- Combined Approach
css-variables-only.constant.ts
Review Complete Styling Example
Here’s a comprehensive example that demonstrates styling all available components. This configuration is production-ready and includes:- Accessibility compliance: standards
- Cross-browser compatibility: Tested across major browsers
- Mobile responsiveness: Touch-friendly targets and spacing
complete-styling.constant.ts
Apply Best Practices
Keep your brand values in one shared constant and pass them to the checkout, as in Implement Brand Styles. For theme-level tokens, prefer cssVariables over inline styles.Follow Common Styling Patterns
Responsive Design
Mobile-First Approach
Mobile-First Approach
The checkout fills the width of the container you mount it into, and media queries inside the checkout iframe respond to that width, not to the browser window. Control the checkout’s width on your container, with your own media queries:Then size fields and buttons for touch:
checkout-container.css
mobile-first.constant.ts
Accessibility Considerations
Accessibility Considerations
Ensure your styling meets accessibility standards:
accessible.constant.ts
quick checks: 16px min text, ≥4.5:1 contrast, visible focus ring, 44px touch targets, no color-only semantics.
Performance Optimization
Performance Optimization
Optimize your styles for better performance:
optimized.constant.ts
Brand Integration
Color Consistency
Use your brand colors consistently across all payment elements to maintain visual cohesion.
Typography Matching
Set
fontFamily and fontWeight in styles to match your site. Your page’s web fonts aren’t loaded inside the checkout iframe, so choose a font that’s installed on the customer’s device, with a system fallback.Border Radius
Maintain consistent border radius values that match your site’s design language.
Animation Timing
Use consistent transition durations (typically 0.2s-0.3s) for a cohesive user experience.
Common Styling Patterns
- Dark Mode
- Minimal Design
dark-mode.constant.ts