Skip to main content

Typography

trust-ui v2 ships with Geist (Vercel) for sans + mono. The fonts are bundled as variable fonts via @fontsource-variable/geist, no additional setup needed — they auto-load when you import trust-ui-react/styles.css.

Font families

TokenValue
--tui-font-sans'Geist Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif
--tui-font-mono'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace
--tui-font-familyalias for --tui-font-sans (backwards-compat)

Font sizes

TokenDesktopMobile (pointer:coarse)
--tui-font-size-xs0.75rem (12px)0.8125rem (13px)
--tui-font-size-sm0.8125rem (13px)0.875rem (14px)
--tui-font-size-md0.875rem (14px)1rem (16px)
--tui-font-size-lg1rem (16px)1.125rem (18px)
--tui-font-size-xl1.125rem (18px)1.25rem (20px)
--tui-font-size-2xl1.375rem (22px)1.5rem (24px)

Why two scales? Desktop baseline is 14px (denser, Linear/Vercel-style discipline). Mobile baseline is 16px — iOS Safari auto-zooms <input> whose font-size is below 16px on focus; this token automatically prevents that.

Font weights

Geist is a variable font supporting all weights 100–900. trust-ui exposes the common stops:

TokenValue
--tui-font-weight-normal400
--tui-font-weight-medium500
--tui-font-weight-semibold600
--tui-font-weight-bold700

Letter spacing

For tight headings (A-discipline Linear-style):

TokenValue
--tui-letter-tight-0.011em
--tui-letter-tighter-0.022em

Apply on headlines:

h1 { letter-spacing: var(--tui-letter-tighter); }
h2 { letter-spacing: var(--tui-letter-tight); }

Line height

TokenValue
--tui-line-height1.5

Custom fonts

To override Geist with your own:

:root {
--tui-font-sans: 'Your Font', system-ui, sans-serif;
--tui-font-mono: 'Your Mono Font', monospace;
}

trust-ui inlines Geist as data URIs in styles.css so the bundle is self-contained. If you don't want Geist, override before importing — but the woff2 will still be in the bundle. To exclude it entirely, fork the package and remove the fonts.css import from src/index.ts.