Typography
Components: Text, Heading, Code
Set text with Text, Heading and Code; raw classes go only on your own elements.
What you use
There are no heading-* or body-* classes, no font-regular, and no semibold value on the weight prop.
Rules
- If you need body text in an app screen, pass
size="sm"(14/20).Textdefaults tolg(16/24). - If you see
size="md"onTextortext-md, writesm/text-sm. They render the same 14/20. - If you need a heading, set
asto the real level.Headingdefaults toh1,size="xl",weight="bold". - Never pass
classNametoText(the build fails) orHeading(it is ignored). Style a wrapper element instead. - If a
TextorCodesits inside a<p>, passasChildwith a<span>child. Both render a<p>. Still passsize:asChildkeeps the default (16px). leading-Nis N pixels (leading-5is 5px). For a size's paired line height, use the named step (leading-sm= 20px).- Never use
leading-noneorlineHeight="none": 0px, lines overlap. - Keep
lineClamp1–6; higher values get no CSS. - If you mark an error, use
color="danger"onTextandcolor="destructive"onCode. Neither accepts the other's value. - Never add letter spacing below 20px.
Headingsets tracking per size. - Never use
font-pixelyourself (decorative:EmptyStatetitles andHoverCardTitle variant='agent'only) orfont-serif(points at Inter, not bundled) in app screens. - If you need weight 800, write
font-extrabold, never the misspelledfont-extrablod. font-mediumis 450, not 500. You load no font: the theme ships Geist and Geist Mono.
Examples
A section header with a secondary description and a code value.
Inline text inside a paragraph you own, with its size set to match.
A style the props lack goes on a wrapper.
Reference
Size scale (text-* sets size and paired line height, px)
Weights
Component sizes (size / line height)
Component colors
Text has no success, warning or brand. Without truncate, Text keeps line breaks. Code accepts className.