PrimerThemeOverride is the type of the theme prop on PrimerCheckoutProvider. It holds design-token overrides for light mode and dark mode, and every Primer component inside the provider draws with the result.
The SDK ships a default set of tokens for each mode. Your light overrides are merged onto the light defaults and your dark overrides onto the dark defaults, one key at a time. You set only the tokens you want to change. A token you leave out keeps its default, except that some colors follow another color you set. See Tokens that follow others.
Type
Token groups
Each mode takes the same six optional groups.Apply a theme
Pass the theme toPrimerCheckoutProvider. It styles every Primer component inside the provider: PrimerCheckoutSheet, and the components you compose in a custom layout.
Values the SDK ignores
nullorundefinedkeeps the default for that token.- A
NaNor infinite number keeps the default, and the SDK logs the warning[PrimerCheckoutTheme] A NaN or infinite theme number is ignored.
Light and dark mode
Setsettings.uiOptions.appearanceMode on the provider to choose which set of tokens applies.
When the device reports no preference, the checkout uses light mode. The provider reads
appearanceMode on every render, so a change applies right away.
usePrimerTheme
PrimerCheckoutProvider, the result follows your theme and appearanceMode. Outside one, it returns the default tokens for the device’s light or dark setting, without your overrides and without appearanceMode. Primer components that can render outside a provider, such as the status screens, use those defaults too.
Returns
PrimerTokens:
Example
Fonts
Every text style uses the brand font,typography.fontFamily, unless the style sets its own. The default is Inter. It ships inside the package and the SDK registers it, so it needs no setup.
To use your own font, register it in your app as you would any React Native font, then set its family name as typography.fontFamily under both light and dark. See Typography tokens.
Per-input overrides
Each Primer input also takes atheme prop of type PrimerTextInputTheme, which overrides the tokens for that one input. See Card inputs.
Exported types
Import these withimport type { ... } from '@primer-io/react-native'.
See also
Color tokens
All 32 colors with their light and dark defaults.
Typography tokens
The brand font and the six text styles.
Spacing tokens
The padding and gap scale.
Shape tokens
Corner radii, sizes and border widths.