PrimerColorTokens holds the 32 colors that Primer’s components draw with. You override them per mode in the theme prop of PrimerCheckoutProvider, under light.colors and dark.colors. Both take Partial<PrimerColorTokens>, so you set only the colors you want to change.
Each value is a React Native color string. The defaults are hex #rrggbb, or #rrggbbaa when the color has transparency. overlay is the exception: it defaults to rgba(0,0,0,0.5).
Light and dark are separate. A color you set under light isn’t used in dark mode, and a color you leave out of dark keeps the dark default, unless it follows another dark color you set (see Tokens that follow others).
Brand
Background
Text
Border colors (outlined)
Border colors (transparent)
Reserved for elements with a transparent border. No component reads these tokens.Icon colors
Utility
Override colors
theme to PrimerCheckoutProvider. See PrimerThemeOverride for how to apply it and how to choose the mode.
Tokens that follow others
Some tokens follow another token in the same mode unless you set them too, so one change can recolor several elements:brandmovesfocus,loaderandborderOutlinedSelected. Throughfocus, it also movesborderOutlinedFocusandborderTransparentFocus.focusmovesborderOutlinedFocusandborderTransparentFocus.backgroundPrimarymovesbackgroundOutlinedDefaultandonBrand.textPrimarymovestextOutlinedDefault.
See also
PrimerThemeOverride
Apply a theme, choose light or dark mode and read tokens with usePrimerTheme.
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.