TypographyOverrides lets you override the typography tokens used across Primer Checkout text styles. Pass it to a PrimerCheckoutTheme through the typography parameter. Every token is optional — any token you leave nil falls back to the internal default, and within a token any nil property falls back to its default value.
All tokens use the Inter font with their documented defaults. You only override the tokens and properties you want to change.
TypographyOverrides
| Token | Type | Default | Description |
|---|---|---|---|
titleXlarge | TypographyStyle? | nil | Title extra large: Inter, -0.6 letter spacing, weight 550, size 24, line height 32. Used for sheet titles. |
titleLarge | TypographyStyle? | nil | Title large: Inter, -0.2 letter spacing, weight 550, size 16, line height 20. Used for section headers. |
bodyLarge | TypographyStyle? | nil | Body large: Inter, -0.2 letter spacing, weight 400, size 16, line height 20. Used for input text and body copy. |
bodyMedium | TypographyStyle? | nil | Body medium: Inter, 0 letter spacing, weight 400, size 14, line height 20. Used for labels and descriptions. |
bodySmall | TypographyStyle? | nil | Body small: Inter, 0 letter spacing, weight 400, size 12, line height 16. Used for helper text and errors. |
Preview
titleXlarge — The quick brown fox jumps over the lazy dog
titleLarge — The quick brown fox jumps over the lazy dog
bodyLarge — The quick brown fox jumps over the lazy dog
bodyMedium — The quick brown fox jumps over the lazy dog
bodySmall — The quick brown fox jumps over the lazy dog
TypographyStyle
A single typography style. All properties are optional — anynil property falls back to the token default.
TypographyStyle is nested inside TypographyOverrides, so refer to it as TypographyOverrides.TypographyStyle when you need the fully qualified name.| Property | Type | Default | Description |
|---|---|---|---|
font | String? | nil | Custom font family name (e.g., "Inter") |
letterSpacing | CGFloat? | nil | Letter spacing in points |
weight | Font.Weight? | nil | SwiftUI font weight (e.g., .regular, .semibold, .bold) |
size | CGFloat? | nil | Font size in points |
lineHeight | CGFloat? | nil | Line height in points |
Override example
Override only the tokens and properties you need. Anything you omit keeps its default.PrimerCheckoutTheme. See PrimerTheme for how to apply it.
See also
PrimerTheme
Assemble and apply a complete theme with all token overrides.
Color Tokens
Override the color tokens used across the checkout UI.
Spacing Tokens
Adjust spacing tokens for padding and layout.
Shape Tokens
Customize corner radius and border width tokens.