Skip to content

Typography

Stratum’s type tokens cover font sizes, weights, line heights, and letter spacings. Every Text and Heading component derives from these — no raw values appear in component code.

import { fontSizes, fontWeights, lineHeights, letterSpacings } from '@/tokens';
TokenValueDefault use
fontSizes.xs11pxCaptions, timestamps, fine print
fontSizes.sm13pxLabels, secondary text
fontSizes.md15pxBody copy (base size)
fontSizes.lg17pxHeading 4, emphasized body
fontSizes.xl20pxHeading 3
fontSizes['2xl']24pxHeading 2
fontSizes['3xl']30pxHeading 1
TokenValueUse
fontWeights.regular'400'Body text
fontWeights.medium'500'Labels, captions
fontWeights.semibold'600'Form labels (above), headings 3–4
fontWeights.bold'700'Headings 1–2

Note: React Native expects weight as a string literal (e.g. '600'), not a number. These tokens are already typed as strings.

Line heights are multipliers — multiply by the font size to get the actual height.

TokenMultiplierUse
lineHeights.tight1.2Headings
lineHeights.normal1.4Most body text
lineHeights.relaxed1.6Long-form reading copy, captions
const styles = StyleSheet.create({
body: {
fontSize: fontSizes.md,
lineHeight: fontSizes.md * lineHeights.relaxed, // 15 × 1.6 = 24
},
});
TokenValueUse
letterSpacings.tight-0.3Tight large headings
letterSpacings.normal0Default
letterSpacings.wide0.3Labels, badges
letterSpacings.wider0.6Uppercase section titles
letterSpacings.widest1.2Allcaps labels

Font family is set per theme, not as a global token. Each theme implements:

theme.typography.fontFamily.heading // heading typeface
theme.typography.fontFamily.body // body typeface
theme.typography.fontFamily.mono // monospace typeface

The value 'System' uses the platform default (San Francisco on iOS, Roboto on Android). Custom themes can supply brand typefaces.

Use Text and Heading atoms for all text — they apply these tokens automatically. Only reach for raw token values when styling non-component text (e.g. inside a third-party library):

import { fontSizes, fontWeights } from '@/tokens';
// In a StyleSheet for custom components:
label: {
fontSize: fontSizes.sm,
fontWeight: fontWeights.medium,
},