Skip to main content
Primer Checkout Android SDK is currently in beta (v3.0.0-beta). The API is subject to change before the stable release.

TypographyTokens

data class TypographyTokens(
    val titleXlarge: TypographyStyle = TypographyStyle(size = 24, weight = 550, lineHeight = 32, letterSpacing = -0.6f),
    val titleLarge: TypographyStyle = TypographyStyle(size = 16, weight = 550, lineHeight = 20, letterSpacing = -0.2f),
    val bodyLarge: TypographyStyle = TypographyStyle(size = 16, weight = 400, lineHeight = 20, letterSpacing = -0.2f),
    val bodyMedium: TypographyStyle = TypographyStyle(size = 14, weight = 400, lineHeight = 20, letterSpacing = 0f),
    val bodySmall: TypographyStyle = TypographyStyle(size = 12, weight = 400, lineHeight = 16, letterSpacing = 0f),
)
TokenSizeWeightLine heightUsage
titleXlarge24sp55032spSheet titles
titleLarge16sp55020spSection headers
bodyLarge16sp40020spInput text, body
bodyMedium14sp40020spLabels, descriptions
bodySmall12sp40016spHelper text, errors
All tokens use the Inter variable font by default. Override font to use your own font resource.

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

data class TypographyStyle(
    @FontRes val font: Int,
    val letterSpacing: Float,
    val weight: Int,
    val size: Int,
    val lineHeight: Int,
)
PropertyTypeDescription
fontIntAndroid font resource ID (@FontRes). Defaults to Inter variable font.
letterSpacingFloatLetter spacing in sp
weightIntFont weight (400 = regular, 550 = semi-bold, 700 = bold)
sizeIntFont size in sp
lineHeightIntLine height in sp

toTextStyle()

fun toTextStyle(): TextStyle
Converts to a Compose TextStyle for use in composables.