Skip to main content
Primer Checkout React Native SDK is currently in beta (v3.0.0-beta.1). The API is subject to change before the stable release.
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).
Start with brand. Primary buttons such as Pay use it, and focus borders, loaders and selected borders follow it unless you set them. If your app supports dark mode, set brand under dark too.

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

Pass 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:
  • brand moves focus, loader and borderOutlinedSelected. Through focus, it also moves borderOutlinedFocus and borderTransparentFocus.
  • focus moves borderOutlinedFocus and borderTransparentFocus.
  • backgroundPrimary moves backgroundOutlinedDefault and onBrand.
  • textPrimary moves textOutlinedDefault.
A token you set always wins over the token it follows. A token follows only when you change its source away from that mode’s default.

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.