For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Font System

Typography should strictly follow the design system's type ladder. Learn how tabular numerals prevent layout jitter and how to maintain consistent typographic hierarchy.

Typography is governed by system design tokens. Components consume standard sizes and font families defined by the design system; they should not define arbitrary pixel values or reach for monospace fonts to solve spacing problems.


1. Dynamic Numbers and Width Jitter

When a number dynamically ticks—such as in a live counter, timer, download progress indicator, or financial ticker—the box around it frequently jitters.

  • ❌ The Error: Using default proportional figures or switching the whole font to font-mono. In proportional typefaces, each digit has a different width (e.g. 1 is much narrower than 8), causing the container width to shake on every tick. Switching to font-mono stops the shaking, but changes the letterforms and breaks typographic consistency with surrounding text.
  • ✅ The Fix: Add tabular-nums (font-variant-numeric: tabular-nums). This activates the typeface's built-in tabular figures feature, giving every digit an identical width while preserving the font's aesthetic design.
WrongProportional
1,111
Righttabular-nums
1,111
"use client";

import { useEffect, useState } from "react";

💡 Usage Boundary: Do not apply tabular-nums globally to body paragraphs. Proportional figures are designed for reading rhythm in prose; reserve tabular-nums specifically for counters, timers, data tables, and metrics.


2. The Type Scale Ladder

Stick strictly to the established typographic scale instead of arbitrary one-off pixel values:

ClassFont Size / Line HeightPrimary Role
text-xs12px / 16pxBadges, timestamps, small annotations, helper text
text-sm14px / 20pxSecondary copy, form labels, table cells, button text
text-base16px / 24pxDefault body copy, long-form paragraphs
text-lg18px / 28pxEmphasized body text, card headers
text-xl20px / 28pxSection titles, modal headings
text-2xl24px / 32pxPage titles, major category headers
text-3xl30px / 36pxHero metrics, key dashboard stats
text-4xl+36px+Marketing display headlines

A higher level on the ladder should differ by size, font weight, and line-height simultaneously. A heading that only changes in font size without proportional weight often competes with the body text below it rather than commanding the hierarchy.