Typography
The four font roles, the type scale used across the catalog, weights and the rules for setting text in NachUI.
Font roles
Save changes before you leave
Body text, labels, buttons and form fields. On this site: Hanken Grotesk.
Billing and invoices
Every h1 to h6 and the titles of cards and dialogs. On this site: Bricolage Grotesque.
A page should read like a well set book, not a control panel.
Long reading text through .prose-reading. Falls back to sans. On this site: Hanken Grotesk.
pnpm dlx nachui add dialog
Code, keyboard keys and the small .section-label. On this site: DM Mono.
| Role | Utility | Variable | Used for |
|---|---|---|---|
| Sans | font-sans | --font-sans | Body text, UI labels, form elements |
| Heading | font-heading | --font-heading | Every h1 to h6 |
| Serif | font-serif | --font-serif | Long-form reading text via .prose-reading |
| Mono | font-mono | --font-mono | Code, keyboard keys, .section-label |
--font-serif is optional. .prose-reading falls back to sans when it is not set, which is exactly what this site does: the serif slot points at Hanken Grotesk, the same family as the body.next/font; in any other setup a plain @font-face and a variable on :root do the same job.Type scale
Quiet type, clear order
Badges, captions, small buttons
Quiet type, clear order
Default UI text: buttons, menus, fields
Quiet type, clear order
Large controls, inputs on mobile
Quiet type, clear order
Lead paragraphs, h4
Quiet type, clear order
h3, dialog titles
Quiet type, clear order
h2
Quiet type, clear order
h1 on small screens
Quiet type, clear order
h1, section titles
Quiet type, clear order
Display only, never inside components
text-sm for buttons, menus and fields, and text-xs for badges, captions and small controls. Inputs use text-base on small screens and drop to text-sm from md up, because iOS zooms into any field with text under 16px.text-5xl is on the scale for display headlines on marketing pages. No component in the catalog uses it.Site scale
| Role | Phone | Tablet | Desktop | Classes |
|---|---|---|---|---|
| Page title | 30 | 30 | 36 | text-3xl lg:text-4xl |
| Page intro | 18 | 20 | 20 | text-lg md:text-xl |
Section heading (h2) | 20 | 24 | 24 | text-xl md:text-2xl |
Subheading (h3) | 18 | 18 | 18 | text-lg |
| Reading text | 16 | 17 | 17 | text-base md:text-[17px] |
| Tables | 14 | 14 | 14 | text-sm |
| Code block | 13 | 13 | 13 | text-[13px] |
| Metadata | 12 | 12 | 12 | text-xs |
em (text-[0.875em]), so it follows whatever text it sits in. Nothing goes below 11px, and no size depends on the window height.Weights
font-semibold allows, it probably needs more space or a bigger step instead.Body text and descriptions
Buttons, labels, menu items, badges. The most used weight in the catalog
Headings, card and dialog titles
The h1 of a page and little else
Rules
- Sentence case everywhere. Buttons, menu items, titles and labels capitalize the first word only: "Save changes", not "Save Changes". It reads calmer and is easier to translate.
- Tabular numbers for anything that changes or lines up. Counters, prices, timers, table columns and pagination use
tabular-nums, so digits keep the same width and nothing jumps when a value updates. - Antialiased rendering. The body sets
antialiased, so text looks the same weight across macOS and other platforms. - No letter spacing on body text. Headings can tighten with
tracking-tight; running text stays at 0. - Long reading text uses
.prose-reading. It sets the serif role,text-muted-strong, 15px and a line height of 1.75, which is easier on the eye for paragraphs than UI text is.
- Small labels use
.section-label. It is the mono, 11px, muted label you see above groups on this page.
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.