Skip to main content
Align the checkout form with your brand and design system. Consistent styling improves user trust, reduces friction, and keeps the experience accessible across devices. The PayNext SDK supports two complementary approaches:
  • Inline styles: Apply React CSSProperties to individual elements through styles
  • 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 with cssVariables, then fine-tune individual elements with styles:
Keep your brand values in one shared constant, so your page and the checkout use the same colors and radii.
CSS custom properties defined on your page, such as var(--color-primary), don’t resolve inside the checkout iframe. Pass the actual values instead.

Configure StylesConfig

The StylesConfig 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).
Match the default 40px height when possible so the button aligns with other wallet controls. Increase padding for better tap targets on mobile.
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
Available from SDK version 1.1.0.

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
Available from SDK version 1.2.0.

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
Available from SDK version 1.2.0.
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
Use cssVariables for theme-level changes and component-level styles for fine-grained control. They work together—component styles take precedence over CSS variables.
Element-level styling properties accept 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.constant.ts
CSS variables are the simplest way to customize the checkout. Use them for theme-level changes without touching component styles.

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
This production-ready example includes compliance: 16px min text, 44px touch targets, ≥4.5:1 contrast, and visible focus states.

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.
The checkout renders inside an iframe, so your page’s CSS custom properties don’t resolve there. A value such as var(--color-primary) falls back to the browser default — pass the actual color instead.

Follow Common Styling Patterns

Responsive Design

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:
checkout-container.css
Then size fields and buttons for touch:
mobile-first.constant.ts
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.
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.constant.ts
Prefer cssVariables for dark mode. See Theme Support for more presets.