Typography
Pika has one global type scale. Text sizes, line heights, weights and letter spacing come from --p-* tokens, so components and your own UI line up with each other. Font families are covered in Fonts. The Typography components (Heading, Text, Paragraph and the rest) set text in this scale for you.
#Type scale
Nine steps, each a font size paired with a fixed line height. The scale is tuned for dense interfaces: steps 1 to 4 (10 to 14px) carry most of the text.
| Step | Sample | Size / line height |
|---|---|---|
| 1 | The quick brown fox jumps over the lazy dog | 10 / 14--p-font-size-1 |
| 2 | The quick brown fox jumps over the lazy dog | 11 / 16--p-font-size-2 |
| 3 | The quick brown fox jumps over the lazy dog | 12 / 16--p-font-size-3 |
| 4 | The quick brown fox jumps over the lazy dog | 14 / 20--p-font-size-4 |
| 5 | The quick brown fox jumps over the lazy dog | 16 / 24--p-font-size-5 |
| 6 | The quick brown fox jumps over the lazy dog | 18 / 26--p-font-size-6 |
| 7 | The quick brown fox jumps over the lazy dog | 20 / 28--p-font-size-7 |
| 8 | The quick brown fox jumps over the lazy dog | 24 / 32--p-font-size-8 |
| 9 | The quick brown fox jumps over the lazy dog | 30 / 38--p-font-size-9 |
| Step | --p-font-size-N | --p-line-height-N | Typical use |
|---|---|---|---|
| 1 | 10px | 14px | Micro monospace labels, badges |
| 2 | 11px | 16px | Monospace metadata |
| 3 | 12px | 16px | Secondary info, captions, timestamps |
| 4 | 14px | 20px | Body text and messages (default) |
| 5 | 16px | 24px | Large body, h4 |
| 6 | 18px | 26px | h3, panel titles |
| 7 | 20px | 28px | h2 |
| 8 | 24px | 32px | h1, page titles |
| 9 | 30px | 38px | Display |
Always use a step’s size and line height together:
.my-caption {
font-size: var(--p-font-size-3);
line-height: var(--p-line-height-3);
}Line heights are fixed pixels so rows in dense lists stay aligned. For long-form reading, such as documents, use --p-line-height-prose (1.6) instead.
#Weights
| Token | Value |
|---|---|
--p-font-weight-regular | 400 |
--p-font-weight-medium | 500 |
--p-font-weight-strong | 600 |
--p-font-weight-heavy | 800 |
strong is the emphasis weight, the same in light and dark. See Check the font weights.
#Letter spacing
| Token | Value | Typical use |
|---|---|---|
--p-letter-spacing-tight | -0.01em | Large headings |
--p-letter-spacing-normal | 0 | Everything else |
--p-letter-spacing-wide | 0.02em | Small text that needs air |
--p-letter-spacing-widest | 0.08em | Uppercase eyebrows and labels |
#Controls
Control sizes keep their own tokens, --p-common-font-size-tiny / -small / -medium / -large. The first three point at steps 3, 4 and 4 (12, 14 and 14px). large stays at 15px, which sits between steps 4 and 5.
#Text color
Every theme root (:root and any element with data-p-theme-mode, such as a ConfigProvider that sets themeMode) sets color to --pw-alias-label-primary. Text inside it never falls back to the browser’s black, which would be unreadable in dark mode. Font family and size are not set on the root: they stay inherited from your page.