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.
PrimerTypographyTokens holds the brand font and the six text styles that Primer’s components use. You override them per mode in the theme prop of PrimerCheckoutProvider, under light.typography and dark.typography. Both take a PrimerTypographyOverride, in which every field is optional.

PrimerTypographyTokens

The resolved tokens, as usePrimerTheme returns them.
fontFamily is the brand font. Every style uses it unless the style names its own font. The default is Inter, which the SDK bundles and registers for you.

Defaults

The defaults are the same in light and dark mode. Sizes are in React Native layout units, and every style uses the brand font.
Font weights are strings from '100' to '900' in steps of 100.

PrimerTypographyStyle

PrimerTypographyOverride

What you pass under light.typography or dark.typography.
How the override merges:
  • Set fontFamily once to change the typeface of the whole checkout.
  • Set fontFamily on one style to change only that style.
  • Set one field on a style, such as fontSize, and the other fields keep their defaults.
  • A field you set on bodySmall also applies to error, unless you set the same field on error.

Override typography

In this example, error text gets font size 13 from the bodySmall override and weight '600' from its own. Register your own font in your app as you would any React Native font, then set its family name as fontFamily. Primer passes fontFamily to React Native as it is. To restyle the text of a single input, use the typography keys of its PrimerTextInputTheme instead. See Card inputs.

See also

PrimerThemeOverride

Apply a theme, choose light or dark mode and read tokens with usePrimerTheme.

Color tokens

All 32 colors with their light and dark defaults.

Spacing tokens

The padding and gap scale.

Card inputs

Per-input overrides with PrimerTextInputTheme.