Typography
Shavin has three font roles and two type scales: one for Heading, one for Text. Components read the role, never a font name, so changing a font in the theme changes it everywhere.
Font roles
Display
h1 and h2 headings, and Heading sizes 3xl and up at any level.
--font-display · font-display
Body
Everything else: Text, buttons, inputs, labels. The page body uses it at 14px.
--font-body · font-sans
Subheading
h3 to h6 headings. Unset by default, so it falls back to --font-body.
--font-subheading · font-subheading
The defaults are Space Grotesk for display and Inter for body. Heading picks the role from its tag: h1 and h2 get the display font, h3 to h6 get the subheading font, unless the size is 3xl or larger. A font-* class in className always wins.
The subheading font is the body font until you set subheadingFont on ThemeProvider: "body" (the default), "display", or a font family name.
<ThemeProvider
displayFont="Fraunces"
bodyFont="Inter"
subheadingFont="display"
>Monospace
There is no --font-mono token. Code, Kbd and CodeBlock use Tailwind's font-mono class, and Shavin's Tailwind preset and theme-v4.css leave it alone, so you get Tailwind's default monospace stack (ui-monospace, SF Mono, Menlo, Consolas and so on). To change it, set fontFamily.mono in your Tailwind config, or --font-mono in your @theme block on Tailwind 4.
Heading sizes
sm, md and lg are fixed. xl and up are fluid: they grow with the nearest size container (an AppFrame, for example) or, outside one, the window. Each reaches its smallest size at about 400px of container width and its largest at about 900px. The numeric sizes 4 to 11 are aliases.
| Size | Alias | Font size | Notes |
|---|---|---|---|
sm | 4 | 18px | Fixed |
md | 5 | 20px | Fixed |
lg | 6 | 24px | Fixed. The default size |
xl | 7 | 24–30px | Fluid |
2xl | 8 | 30–36px | Fluid |
3xl | 9 | 36–48px | Fluid, display font |
4xl | 10 | 36–60px | Fluid, display font, tight tracking |
5xl | 11 | 36–72px | Fluid, display font, tight tracking |
Heading 3xl
Heading xl
Heading md as h3
Text sizes
Text has no default size: without size it inherits from its parent, which on a plain page is the 14px body. The numeric sizes 1 to 4 are aliases.
| Size | Alias | Class | Font size |
|---|---|---|---|
xs | 1 | text-xs | 12px |
sm | 2 | text-sm | 14px |
md | 3 | text-base | 16px |
lg | 4 | text-lg | 18px |
overline | text-[10px] uppercase | 10px, uppercase, 0.15em tracking |
Text lg, for lead paragraphs.
Text md, 16px. Use it for long-form reading.
Text sm, 14px. The usual size for interface copy.
Text xs, 12px. Captions and helper text.
Overline
Choosing fonts
Pick a font pairing on the theme page. To load your own files or use next/font, see custom fonts.
Typography components
Headings
Heading sizes, tags, weights and the overline label.
Body text
Text sizes, weights and colours.
Em, strong and quote
Italic emphasis, bold importance and inline quotes.
Code and keyboard
Inline code and keyboard keys.
Quotes
Inline quotes and blockquotes.
Lists
Bullet and ordered lists.
Links
Link colours and underline styles.
Custom fonts
Load your own fonts and pass them to ThemeProvider.
Examples
Text components used together in prose.