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, asusePrimerTheme 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 underlight.typography or dark.typography.
How the override merges:
- Set
fontFamilyonce to change the typeface of the whole checkout. - Set
fontFamilyon 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
bodySmallalso applies toerror, unless you set the same field onerror.
Override typography
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.