Theme Configuration
Provide the
theme property on the object you pass into checkout.mount('element-id', { ...config }) after creating the instance with new PayNextCheckout(), as shown in Mount the Checkout.'light' | 'dark' | 'system'
Theme mode for the checkout UI.
'light': Fixed light theme'dark': Fixed dark theme'system': Resolves to browser’sprefers-color-schemeat mount time, then fixedundefined: Defaults to'light'and listens for system theme changes
When
theme is undefined, the SDK automatically updates when the user changes their system theme preference. When explicitly set (including 'system'), the theme is fixed and does not listen to system changes.Payment Button Styling
Payment buttons automatically adapt to the theme:- Apple Pay:
style: 'black'(light) /'white'(dark) - Google Pay:
color: 'black'(light) /'white'(dark) - PayPal:
color: 'gold'(light) /'white'(dark) - Pix: white background with an
#e0e0e0border (light) /#1a1a1abackground with a#333border (dark) - BLIK: black background and border in both themes (the BLIK mark is white on black); the dark theme only softens the border to
#333
styles.ApplePayButton, styles.GooglePayButton, styles.PayPalButton, styles.PixButton, or styles.BlikButton override theme defaults.
Pix Form Theming
Available from SDK version 1.1.0.
- Light theme: white field background, dark text
- Dark theme: dark field background, light text
Custom Pix Form Colors
Override individual colors and the border radius withstyles.PixForm (type PixFormStyles). These map to Stripe’s Appearance API variables, not the --paynext-sdk-* tokens below, since the Pix form renders inside a Stripe-hosted iframe.
pix-form-theme.ts
BLIK Form Theming
Available from SDK version 1.2.0.
Custom BLIK Form Colors
Override individual colors and the border radius withstyles.BlikForm (type BlikFormStyles, the same shape as PixFormStyles). These map to Stripe’s Appearance API variables, not the --paynext-sdk-* tokens below, since the BLIK form renders inside a Stripe-hosted iframe.
blik-form-theme.ts
CSS Variables
Override theme tokens by passingstyles.cssVariables (type CSSVariablesConfig) when you mount the SDK, or target .checkout / .checkout.dark classes from your stylesheet. Unset values fall back to the active theme defaults.
Variables marked “inherits” are not redefined in dark mode and use the light theme value. Variables marked “same” are explicitly set to the same value in both themes.
Complete Token Reference
Override from Config
PasscssVariables through the styles option when mounting:
config-override.ts
Override per Theme
The checkout renders inside an iframe, so your page’s stylesheets can’t override its variables. Set them incssVariables instead. The values you pass apply in both themes, and styles can’t change after mount. To use different values for light and dark, pick the set that matches the theme when you mount:
theme-overrides.ts
Style Presets
Create reusable style presets for different design systems:- Minimal
- Colorful
- Brand Colors
minimal-preset.ts
TypeScript Reference
The SDK exports full type definitions for theme configuration:types.ts
All
CSSVariablesConfig properties are optional. Only override the tokens you need to change.