Primer Checkout iOS SDK is currently in beta (v3.0.0-beta.1).
The API is subject to change before the stable release.
ColorOverrides lets you override individual color tokens used across the checkout UI. You pass an instance to PrimerCheckoutTheme via its colors parameter.Every property is an optional Color?. Any token you leave nil keeps the SDK’s internal default value. Light and dark appearances are resolved automatically by the SDK’s built-in design tokens, so a single override applies in both color schemes.
@available(iOS 15.0, *)public struct ColorOverrides: Equatable { public init( primerColorBrand: Color? = nil, // ... all tokens below, each defaulting to nil )}
Override base tokens such as primerColorBrand to recolor the whole UI in one change. Override semantic tokens (text, border, icon) only when you need a specific element to differ from what its base token resolves to.
Pass a ColorOverrides instance into PrimerCheckoutTheme. Tokens you omit keep their SDK defaults.
import SwiftUIimport PrimerSDKlet theme = PrimerCheckoutTheme( colors: ColorOverrides( primerColorBrand: Color(red: 0.42, green: 0.36, blue: 0.91), primerColorTextPrimary: Color(red: 0.10, green: 0.10, blue: 0.12), primerColorBackground: Color(.systemBackground), primerColorBorderOutlinedError: .red ))struct CheckoutScreen: View { let clientToken: String var body: some View { PrimerCheckout( clientToken: clientToken, primerTheme: theme, onCompletion: { state in // handle the final PrimerCheckoutState } ) }}
Because light and dark values resolve through the SDK’s internal tokens, supply a dynamic Color (for example one backed by an asset catalog color set, or a UIColor with a dynamic provider) when you want different values per appearance.
Overriding a base token such as primerColorBrand cascades to every semantic token that resolves from it (focus ring, loader, selected borders), so you can recolor the checkout with a single change.