PrimerCheckoutTheme is the single container for design-token overrides. Pass it to the entry-point APIs to restyle the checkout UI without replacing Primer’s internal token system.
Internally, the SDK ships auto-generated DesignTokens (light) and DesignTokensDark (dark) values that remain the source of truth. When you supply a PrimerCheckoutTheme, the SDK merges your overrides on top of those defaults — any nil value falls back to the internal default. You only set the tokens you want to change.
Every override property is optional. A
PrimerCheckoutTheme() with no arguments applies the SDK’s default appearance, so you can start from the defaults and override one group, or one token, at a time.Declaration
Initializer
Parameters
Properties
PrimerCheckoutTheme is Equatable and exposes one immutable property per override group. Each is the optional value you passed to the initializer.
Token groups
A theme is made up of six override groups. Each group is its own optional struct whose properties are all optional, so you only specify the tokens you want to change. The four documentation pages below cover the full property list, types, and defaults for every group.The Shape tokens page documents three groups together:
RadiusOverrides, SizeOverrides, and BorderWidthOverrides.Applying a theme
PrimerCheckoutTheme is accepted by all three entry points. The managed view and the UIKit presenter take it as primerTheme; the session takes it as theme.
With the managed view
With a custom layout
Theme example
Build a theme by composing the override groups. Each group only sets the tokens you care about; everything else inherits the SDK defaults.See also
Color tokens
Override brand, semantic, text, border, and icon colors.
Typography tokens
Customize title and body text styles.
Spacing tokens
Tune padding and margin values.
Shape tokens
Radius, size, and border-width overrides.