Skip to content

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.

SizeAliasFont sizeNotes
sm418pxFixed
md520pxFixed
lg624pxFixed. The default size
xl724–30pxFluid
2xl830–36pxFluid
3xl936–48pxFluid, display font
4xl1036–60pxFluid, display font, tight tracking
5xl1136–72pxFluid, 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.

SizeAliasClassFont size
xs1text-xs12px
sm2text-sm14px
md3text-base16px
lg4text-lg18px
overlinetext-[10px] uppercase10px, 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

Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font